Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Reading from a snippet file

$
0
0

Im making a simple notepad program with highlighting, and i want to add snippet support.

 

It already had simple things like add init, or for in the menu but what im looking to do is be able to save my snippets in a ini file and be able to add them as menu items at anytime.

 

i know how i want to go about doing it but i can't seem to get it to work

 

I have the ini file set up like so,

[hello] snip =hello [wassup] snip =wassup [multiline] snip=hi there bob

i wanted to then have the program do this,

$Snip = IniReadSectionNames ( "[snippets].ini" ) For i=0 To $Snip[0] +1    $menu4item[$i] = GUICtrlCreateMenuItem("Dvar", $menu4)    GUICtrlSetOnEvent($menu4item[$i], "readinisec") Next

but i realised this would not work unless i added parameters to setonevent which i dont believe i can.

 

(readinisec, would then read snip fromt the section given in the parameter and add it to the richedit)

 

So does anyone know of a better way to go about this, or if it is possible


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>