DreamVB Posted September 8, 2014 Share Posted September 8, 2014 hi, Is it possible to create an array of structures I started yesterday to build a small lexical scanner, I am trying to build my own little toy scripting language that I will share with you all I already done the code that scans a file and breaks it up into tokens, but now I need a way to store this information I know in VB you use something like this, Example Type TTOKEN TokType As Byte Token As Variant End Type Private Tokens(10) As TTOKEN Tokens(0).TokType = 1 'cmd Tokens(1).Token = "DIR" Tokens(0).TokType = 2 'Num Tokens(1).Token = 2 Is there a way to do something like this in autoit , My idea was maybe use two arrays one for TokTypes and the other for Tokens, but if there is a better way I also like to try that, Anyway help will be very kind. Thanks. On Error Resume Pulling Hair Out. Link to comment Share on other sites More sharing options...
Solution Danyfirex Posted September 8, 2014 Solution Share Posted September 8, 2014 Hi. Local $aArray[2]=[DllStructCreate("dword TokType;wchar Token[100]"),DllStructCreate("dword TokType;wchar Token[100]")] $aArray[0].TokType=1 $aArray[0].Token="Hola" $aArray[1].TokType=2 $aArray[1].Token="Mundo" ConsoleWrite($aArray[0].TokType() & " " & $aArray[0].Token() & @CRLF) ConsoleWrite($aArray[1].TokType() & " " & $aArray[1].Token() & @CRLF) Saludos Gianni, DreamVB and Invicore 3 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
DreamVB Posted September 8, 2014 Author Share Posted September 8, 2014 Thanks I will have a try in my project. Thanks Again, On Error Resume Pulling Hair Out. Link to comment Share on other sites More sharing options...
Danyfirex Posted September 8, 2014 Share Posted September 8, 2014 You can mark the topic as answered. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now