Jump to content
Sign in to follow this  
quicksilver

Text Form to create a textlogging form

Recommended Posts

ok thanks .) it works

edit: an how can i put text from a array into the form? the whole array with a loop?

Edited by quicksilver

Share this post


Link to post
Share on other sites

Hm i dont understand this...

$file = Fileopen("ini.ini",0)
$commands = FileReadLine($file,2)

$cmds = StringSplit($commands, ";")

IF IsArray($cmds) then
....
EndIf

but line 2 is empty in the ini .. but he jumps into the loop and execute the commands ..

Share this post


Link to post
Share on other sites

Hm i dont understand this...

$cmds = StringSplit($commands, ";")

IF IsArray($cmds) then
....
EndIf

<{POST_SNAPBACK}>

StringSplit ALWAYS returns an array, even when there is nothing to split...

You can check with

If UBound($array) > 1 AND NOT $array[1] = "" Then

Share this post


Link to post
Share on other sites

If you're using an INI file, use INI functions. Why are you using FileReadLine?

IniRead("filename", "section", "key", "default")

...as in...

$commands = IniRead("ini.ini", "Commands", "Commands", "#ERROR")
If $commands = "#ERROR" Then
    ...do something...
EndIf
GUICtrlSetData($edit, StringReplace($commands, ";", @CRLF))

The question is: is your INI file a true INI file or just a plaintext file with a list of commands? If it's the latter, is the entire file what you want in the edit box? If so:

$filename = "ini.ini"
GUICtrlSetData($edit, FileRead($filename, FileGetSize($filename)))

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  

×
×
  • Create New...