• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

Hexidecimal characters

Mike Mackinnon

Well Known Member
Does anybody know how to load a "special" character into a One World ER variable, RV variable, or report constant? What I am trying to do is send the special character for ASCII 27 to a report so it can be sent to the printer. Does anybody know how to accomplish this? Thanks in advance.

This time: OW Xe, SP 14

Mike MacKinnon
- One World B733, SP 11.3
- One World Xe B7333, SP 13 Windows NT
 

amwalshjde

Well Known Member
The only way I have done this is to use a custom C function. I have pasted the C code below. The header (not shown) just contains info for the data structure. I use two fields, one to pass in a numeric value (the ascii value) and one to pass back a special character. There are only two lines of code in the Main processing so it's as simple as they get.

B580150.C

#include <jde.h>

#define b580150_c


/*****************************************************************************
* Source File: b580150
*
* Description: Convert ASCII to real representation (NEW) Source File
*
* History:
* Date Programmer SAR# - Description
* ---------- ---------- -------------------------------------------
* Author 4/9/01 - Created

/**************************************************************************
* Notes:
*
**************************************************************************/

#include <b580150.h>


/**************************************************************************
* Business Function: ConvertASCItoChar10a
*
* Description: Convert ASCII Value to Character
*
* Parameters:
* LPBHVRCOM lpBhvrCom Business Function Communications
* LPVOID lpVoid Void Parameter - DO NOT USE!
* LPDSD570150 lpDS Parameter Data Structure Pointer
*
*************************************************************************/

JDEBFRTN (ID) JDEBFWINAPI ConvertASCItoChar10a (LPBHVRCOM lpBhvrCom, LPVOID lpVoid, LPDSD570150 lpDS)
{
/************************************************************************
* Variable declarations
************************************************************************/
int integerI;
/************************************************************************
* Declare structures
************************************************************************/

/************************************************************************
* Declare pointers
************************************************************************/

/************************************************************************
* Check for NULL pointers
************************************************************************/
if ((lpBhvrCom == (LPBHVRCOM) NULL) ||
(lpVoid == (LPVOID) NULL) ||
(lpDS == (LPDSD570150) NULL))
{
jdeErrorSet (lpBhvrCom, lpVoid, (ID) 0, "4363", (LPVOID) NULL);
return ER_ERROR;
}

/************************************************************************
* Set pointers
************************************************************************/

/************************************************************************
* Main Processing
************************************************************************/
MathNumericToInt(&lpDS->mnDocumentOrderInvoiceE, &integerI);
lpDS->cEverestEventPoint01 = (char)integerI;

/************************************************************************
* Function Clean Up
************************************************************************/

return (ER_SUCCESS);
}

/* Internal function comment block */
/**************************************************************************
* Function: Ixxxxxxx_a // Replace "xxxxxxx" with source file number
* // and "a" with the function name
* Notes:
*
* Returns:
*
* Parameters:
**************************************************************************/
 

Zoltan_Gyimesi

Legendary Poster
Mike,
Here is two hints. Maybe one can be work for you.

Create a char event rule variable (e.g. cHex27 based on EV01 data item) to hold the special character.
Create an assignment for this variable as left operand.

1.) If you have this character somewhere and accessible in a word editor then Copy/Paste the value into the "From Object/Literal" field on the assigmnet window.
...OR...
2.) Hold down the ALT key (left ALT key) and enter the decimal code (not the hexadecimal, Hex27 = Dec39 if I am right) of the character on the Numeric Pad part of your keyboard and release the ALT key. Do it while your cursor is in the "From Object/Literal" field on the assigmnet window.

Use your variable to assign, append, concatenate your spec char where you want to use it.

Please, let us know if one of them could work for you. Thanks.

Good luck,
Zoltán


B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)
 

Mike Mackinnon

Well Known Member
Thanks for the suggestion Aaron! I will give this a try.

Zoltan this method does not work (at least for me anyway) since when I try to type <ALT>+27 I get a question mark displayed. I guess that One World cannot interpret the entered character. I also get the same result ("?")when I try the cut and paste method from MS Word.

I appreciate your responses! Thanks again!

Mike MacKinnon
- One World B733, SP 11.3
- One World Xe B7333, SP 14 Windows NT
 

Zoltan_Gyimesi

Legendary Poster
Mike,

Maybe I wasn't enough clear when I described the ALT key method.
You have to enter the DECIMAL code value 39 on the NumPad instead of the HEXADECIMAL code value 27 (decimal 39 is equal to hexadecimal 27).
Please, try it again.

On the other hand, never mind how will this character appear in the Event Rule Designer screens, just try it in your UBE that does it work properly or doesn't.

Regards,
Zoltán


B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)
 
Top