Jump to content
Sign in to follow this  
ne0trace

Modifying a Variable

Recommended Posts

ne0trace

Hello,

I have a variable which looks like this: "12345 - 12389 - 6789 - ...". This is called $variable1 right now. But when I try to paste this information I need split it up. The first block "12345" pasted in the fist box and so on. How can I modify the serial number so it fits in the edit box?

Felix

Share this post


Link to post
Share on other sites
martin

Hello,

I have a variable which looks like this: "12345 - 12389 - 6789 - ...". This is called $variable1 right now. But when I try to paste this information I need split it up. The first block "12345" pasted in the fist box and so on. How can I modify the serial number so it fits in the edit box?

Felix

Using stringSplit would be an easy way.

$stringArray = StringSplit($variable1,'-')

GuiCtrlSetData($edit1, $StringArray[1])....


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
PsaltyDS

Hello,

I have a variable which looks like this: "12345 - 12389 - 6789 - ...". This is called $variable1 right now. But when I try to paste this information I need split it up. The first block "12345" pasted in the fist box and so on. How can I modify the serial number so it fits in the edit box?

Felix

You can split characters with: $avArray = StringSplit($variable1, " - ", 1)

Then you can just loop through the array to put the values where you need them.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  

×