Jump to content
Sign in to follow this  
UnReAl

VB6 WordFromInteger in AutoIt

Recommended Posts

UnReAl

Im currently translating a VB Script to Autoit and got some problems with this "WordFromInteger" - Function.

I`ve tryed "String" but that doesnt help. Im not using VB so I dont have a clue what it does exactly...


Share this post


Link to post
Share on other sites
martin

Im currently translating a VB Script to Autoit and got some problems with this "WordFromInteger" - Function.

I`ve tryed "String" but that doesnt help. Im not using VB so I dont have a clue what it does exactly...

If you're translating you need to have a good idea of what is going on. You haven't given the piece of code where it is used which would help understand what it does but I would expect that WordFromInteger(115) returned "one hundred and fifteen" although it might just return "115" which AutoIt will do for you without any special function. Probably your script doesn't need the number in words rather than the string representation of the number.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
UnReAl

The Code piece:

fData &= "01";New server
fData &= "10";Server ID
fData &= WordFromInteger(Len("Test"))
fData &= cv_HexFromString("Test")
fData &= WordFromInteger(1);Users
fData &= WordFromInteger(500);Max users
fData &= "01";Servermode (00 = check, 01 = online)

My translation:

$fData &= "01";New server
$fData &= "10";Server ID
$fData &= String(StringLen("Test"))
$fData &= _StringToHex("Test")
$fData &= String(1);Users
$fData &= String(500);Max users
$fData &= "01";Servermode (00 = check, 01 = online)

Without "String" there is a fatal error, with "String" there is no error, but it does not work proper...

Edited by UnReAl

Share this post


Link to post
Share on other sites
ProgAndy

a word is a number which is 2 bytes long ;) ( or 4 bits). So use Hex($Number,4) I think.

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.