converting HEX to numbers

I need to call Win API methods from PB and I have an example of how they do 
it in VB.

So I am converting the code to PB. However, there are  variable declarations 
that I need help with:

HOW CAN I CONVENRT THESE HEX NUMBERS INTO REAL NUMBERS TO DECLARE IN PB? 
e.g. &H20 is equal to what in PB?

constant integer  DT_RIGHT = &H2
constant integer  DT_SINGLELINE = &H20
constant integer  DT_TABSTOP = &H80
constant integer  DT_TOP = &H0
constant integer  DT_VCENTER = &H4
constant integer  DT_WORDBREAK = &H10
constant integer  PS_ENDCAP_FLAT = &H200
constant integer  PS_ENDCAP_MASK = &HF00
constant integer  PS_ENDCAP_ROUND = &H0
constant integer  PS_ENDCAP_SQUARE = &H100
constant integer  PS_GEOMETRIC = &H10000
constant integer  PS_JOIN_BEVEL = &H1000
constant integer  PS_JOIN_MASK = &HF000
constant integer  PS_JOIN_MITER = &H2000
constant integer  PS_JOIN_ROUND = &H0
constant integer  PS_STYLE_MASK = &HF
constant integer  PS_TYPE_MASK = &HF0000


THANKS 


0
egattu
8/25/2005 11:33:51 PM
sybase.powerbuilder.general 62418 articles. 19 followers. Follow

2 Replies
1503 Views

Similar Articles

[PageSpeed] 26
Get it on Google Play
Get it on Apple App Store

Use the Windows calculator (calc.exe) in scientific mode. FWIW, 0x20 is 32.

--
Roy

egattu@yahoo.com wrote:
> I need to call Win API methods from PB and I have an example of how they do 
> it in VB.
> 
> So I am converting the code to PB. However, there are  variable declarations 
> that I need help with:
> 
> HOW CAN I CONVENRT THESE HEX NUMBERS INTO REAL NUMBERS TO DECLARE IN PB? 
> e.g. &H20 is equal to what in PB?
> 
> constant integer  DT_RIGHT = &H2
> constant integer  DT_SINGLELINE = &H20
> constant integer  DT_TABSTOP = &H80
> constant integer  DT_TOP = &H0
> constant integer  DT_VCENTER = &H4
> constant integer  DT_WORDBREAK = &H10
> constant integer  PS_ENDCAP_FLAT = &H200
> constant integer  PS_ENDCAP_MASK = &HF00
> constant integer  PS_ENDCAP_ROUND = &H0
> constant integer  PS_ENDCAP_SQUARE = &H100
> constant integer  PS_GEOMETRIC = &H10000
> constant integer  PS_JOIN_BEVEL = &H1000
> constant integer  PS_JOIN_MASK = &HF000
> constant integer  PS_JOIN_MITER = &H2000
> constant integer  PS_JOIN_ROUND = &H0
> constant integer  PS_STYLE_MASK = &HF
> constant integer  PS_TYPE_MASK = &HF0000
> 
> 
> THANKS 
> 
> 
0
Roy
8/26/2005 2:23:52 AM
Here's a script http://www.rgagnon.com/pbdetails/pb-0048.html from 
http://64.18.163.122/rgagnon/howto.html.


Sanjiv.


<egattu@yahoo.com> wrote in message news:430e555f$1@forums-1-dub...
>I need to call Win API methods from PB and I have an example of how they do 
>it in VB.
>
> So I am converting the code to PB. However, there are  variable 
> declarations that I need help with:
>
> HOW CAN I CONVENRT THESE HEX NUMBERS INTO REAL NUMBERS TO DECLARE IN PB? 
> e.g. &H20 is equal to what in PB?
>
> constant integer  DT_RIGHT = &H2
> constant integer  DT_SINGLELINE = &H20
> constant integer  DT_TABSTOP = &H80
> constant integer  DT_TOP = &H0
> constant integer  DT_VCENTER = &H4
> constant integer  DT_WORDBREAK = &H10
> constant integer  PS_ENDCAP_FLAT = &H200
> constant integer  PS_ENDCAP_MASK = &HF00
> constant integer  PS_ENDCAP_ROUND = &H0
> constant integer  PS_ENDCAP_SQUARE = &H100
> constant integer  PS_GEOMETRIC = &H10000
> constant integer  PS_JOIN_BEVEL = &H1000
> constant integer  PS_JOIN_MASK = &HF000
> constant integer  PS_JOIN_MITER = &H2000
> constant integer  PS_JOIN_ROUND = &H0
> constant integer  PS_STYLE_MASK = &HF
> constant integer  PS_TYPE_MASK = &HF0000
>
>
> THANKS
> 


0
Sanjiv
8/26/2005 4:36:44 AM
Reply:

Similar Artilces:

How to convert from string to hex number
Hello, I have a requirement for passing a hex value like this to a function. Example code: my $ipmbAddress = getIpmbAddress(...); ## returns 82 getDeviceID($ip, $ipmbAddress); Here in the above code, the getDeviceID() fucntion will accept only 0x82 (hex number). How to convert the number 82 to 0x82 (Note that this should not be as string) I tried the following but not working properly. $ipmbAddress = "0x".$ipmbAddress; $ipmbAddress = hex("$ipmbAddress"); $ipmbAddress = sprintf(0x%0x, $ipmbAddress); getDeviceID($ip, $ipmbAddress); Please help. T...

how to convert hex string to hex bytes?
Hi I've been trying and haven't found a solution for this yet and hopefully some of you can give me a direction to solve this problem. I have a string in hex representation i.e, 64 chars 'AB23FFFE.....' How can I convert it to 32 chars String where each byte is $AB $23 $FF $FE .... ? Even if I do it manually, can I store the hex(non ASCII) to String? Thanks for looking!! edwin wrote: > I have a string in hex representation i.e, 64 chars 'AB23FFFE.....' > How can I convert it to 32 chars String where each byte is $AB $23 $FF > $FE .... ? Th...

How to convert a hexadecimal number to normal number?
In VB.NET, how can I convert a hexadecimal number (like FF) to normal number (like 255) ?? Come on, gurus, this must be a piece of cake for you!:-) Any help appreciated, thanks, Hooker try to use System.Convert.ToInt16(your parameter) hope this work...if this doesn't work there should be some method in the 'convert' class.Toronto Trade show displays | Toronto Printing Solutions | Toronto Printing...

problem with number/number=number ?
hi i need for below 1/36 = 0,0277777777777778 but result should be 1 3/36 should be 1 35/36 should be 1..... (between 1 and 36)/36 should be 1 36/36  and 37/36 and 45/36 and 71/36 should be 2  (between 72 and 37)/36 should be 2  (between 107 and 73)/36 should be 3  and go on how can i do it ? ThanksMark as me if my question or my answer can be helpful for you :) Hi, I think that (int)(n / 36) + 1 will do the trick  hi it work true without below  result 1 for 1/36 and 4 /36 and 35 /36 .. it is true.. but result 2 for 36/36 . res...

What generals generally do
Reading a McChrystal thread elsewhere, I came across someone quoting a US general http://en.wikipedia.org/wiki/Smedley_Butler > I spent 33 years and four months in active military service and > during that period I spent most of my time as a high class thug for > Big Business, for Wall Street and the bankers. In short, I was a > racketeer, a gangster for capitalism. I helped make Mexico and > especially Tampico safe for American oil interests in 1914. I helped > make Haiti and Cuba a decent place for the National City Bank boys to > collect revenues in. I ...

Converting to Hex
Is there a simple way, like a one liner perhaps, that will give me the octal/hex value of a character? I need to look certain characters up, so I would like to be able to give it something like an 'a' or even "\n" and have it answer 141 or 012 (assuming UNIX). Thanks for your time. James check out sprintf() and ord() quickly for you example: ## hex perl -e 'printf("%x", ord("\n"))' ## oct perl -e 'printf("%o", ord("\n"))' > -----Original Message----- > From: James Edward Gray II [m...

VB.NET: How to convert hexadecimal number to normal (decimal) number?
Hi to all VB.NET function Hex() converts numbers to hexadecimal strings, is there any reverse function that converts hexadecimals back to numbers?? Thanks, Hooker Hi, how are you? In C#, we have something like: Convert.ToInt32(string strValue, int Base)... So I basically can do: Int iDecimal = Convert.ToInt32("AF8", 16); I'm pretty sure there must be something like it on VB.Net. Hope this Helps, Covohttp://covodev.blogspot.com/"Everything should be made as simple as possible, but not simpler", A. Einstein That should work, thanks. I'm fine, BTW...

PowerBuilder number
I have received "438" for resultcode when I using a OLEOBJECT function in PB. According to the help, resultcode is a UnsignedLong by value (a PowerBuilder number identifying the exception that occurred on the server). Does anyone know where I can get the meaning of 438. Thx. According to my research, 438 means: object dosen't support property or method. Which function were you calling and what are you trying to accomplish? Are you sure the OLE Server has been started? On Wed, 18 Jun 2003 05:57:59 -0400, in powersoft.public.powerbuilder.objects <GL> wro...

Convert from hex
echo http%3A%2F%2Fwww.merifiles.com%2Fuploads%2Fmf_aR_Ek_Ajnabi_-_01_-_Ek_Ajnabi_%28Mama_Told_Me%29%28128Kbps%29.mp3| perl -e ' $_=<>;s/%(..)/\\x$1/xg; print "$_"; ' This outputs http\x3A\x2F\x2Fwww.merifiles.com\x2Fuploads\x2Fmf_aR_Ek_Ajnabi_-_01_-_Ek_Ajnabi_\x28Mama_Told_Me\x29\x28128Kbps\x29.mp3 Why does print not print the hex character in question? But, -bash-2.05b$ perl -e ' > print "http\x3A\x2F\x2Fwww.merifiles.com\x2Fuploads\x2Fmf_aR_Ek_Ajnabi_-_01_-_Ek_Ajnabi_\x28Mama_Told_Me\x29\x28128Kbps\x29.mp3" > ' http:/...

When is a number not a number?
I've got some server script that determines the "SELECTED" entry in a SELECT control. (The code below is a snippet.) If no information is returned then I want the number defaulted a hard-coded value, otherwise, I want number that matches the returned value selected. The defaulted, hard-coded value works but the comparison (i == val) doesn't work if a a value was returned in the information. I've verified that it is indeed a number within the range I want. Why would this comparison fail like this? TIA Alan Rosine <snip> if (docInfo.advPayMonths =...

Converting current code (Powerbuilder 6.5.1) to newest version of Powerbuilder?
Hi, can anyone tell me what you have to do in order to convert existing code (applications) (created under Powerbuilder 6.5.1) to the newest version of Powerbuilder (at least PB 8) and what it would take to use that code (applications) on the web, I do understand that the newer versions of PB have a web datawindow, is that all we would need to use to move our applications to the web? Thanks Look in this newsgroup aroung 01/08/02 for "Applications on the Web" (started by "John") for a good stream of information. JKerstens <John.Kerstens@gnb.ca> wrot...

convert number to text
hi, I have to convert number to text (100 -> hundred) is there any one who know where to find a function to do that thx -- Alexis Maillot Hi Alexis. I dont think that there is such a function, but who knows but you can make one your self! Start by deciding how large numbers you want to handle for ex max is one million then you know you have six digits to handle sample 1.236.123 This would render the text onemillion twohundredthirtysixthousend onehundredtwentythree or a format you prefer Start by picking out the lengt of the string lets just st...

convert number to word
Hi, Can any one help me ? How to convert number to word? ie., 123......means .........one hundereden twenty three. Regards pvs "Preeth" <preethavswamy@yahoo.com> �������/�������� � �������� ���������: news:WGCbtCRdCHA.278@forums.sybase.com... > Hi, > > Can any one help me ? How to convert number to word? > ie., 123......means .........one hundereden twenty three. > > Regards > pvs > > > I use computed field Preeth wrote: >Hi, > >Can any one help me ? How to convert number to word? >ie., 123.........

convert string to number?
Hi, I have a problem where a number read from a file is being treated as a string by perl (I think!). I am using the module RSPerl which is an interface between Perl and the statistical language R. When i read a column of numbers from a file and pass it to the perl/R function i get an "invalid 'type' (character) of argument" error. The reason i think this is a problem on the Perl side is shown by this pseudocode: while(<FILE>){ ... stuff to extract $value from each row ... push(@list1, $value); } @list2 = (100.2, 232.333, 344.2); # these ...

Web resources about - converting HEX to numbers - sybase.powerbuilder.general

Facebook Begins Converting Users To HTTPS
Are you willing to sacrifice a little bit of speed for a lot more safety? Facebook is asking that very question with its announcement that it ...

Facebook No Longer Converting Groups Into Pages
Back when Facebook first launched Facebook Pages, many businesses and brands who had built up substantial audiences in their Facebook Groups ...

Vert - simply converting for iPhone, iPad, and iPod touch on the iTunes App Store
Get Vert - simply converting on the App Store. See screenshots and ratings, and read customer reviews.

Converting SIM Card to Micro SIM Card - Flickr - Photo Sharing!
Place new Micro SIM into the iPhone SIM card tray

Ayaan Hirsi Ali on Converting Muslims to Christianity - YouTube
Complete video at: http://fora.tv/2010/07/29/Nomad_From_Islam_to_America_with_Ayaan_Hirsi_Ali Ayaan Hirsi Ali explains her support of missionary ...

Click go fears of converting print files
Is there a way to convert a print queue item to a .RTF or .PDF file? I like to save or email them. - The Sydney Morning Herald

Sudanese woman ordered to hang under sharia law for converting to Christianity gives birth
Khartoum, Sudan: A Christian Sudanese woman sentenced to hang for apostasy has given birth in jail, a Western diplomat said on Tuesday.

Imams warn against radicalism to Aboriginal inmates converting to Islam
The prison system has enlisted the help of ASIO to crack down on radicalisation behind bars amid revelations that Aboriginals are converting ...

Converting the world's companies one by one - The Science Show - ABC Radio National (Australian Broadcasting ...
Image: Trucks carrying logs make their way up a road in Jambi, Indonesia. A vast area of the Sumatran forest, and orangutan habitat, is being ...

Converting Churches Into Homes Is The Latest Hollywood Trend
You don't have to be a believer to be moved by the beauty of a church.

Resources last updated: 12/11/2015 3:07:10 PM