Quote from sakismor on July 15, 2019, 8:07 pmHello to the community,
I have a listbox that is having 4 list items. And I try to save it all the list items to a file as a variable and then everytime I want to read the file and all items list it to the list box with the Loadvariable function.
I must say that in file is having and others variable so it is not possible to have only the listbox items.
Best regards
Hello to the community,
I have a listbox that is having 4 list items. And I try to save it all the list items to a file as a variable and then everytime I want to read the file and all items list it to the list box with the Loadvariable function.
I must say that in file is having and others variable so it is not possible to have only the listbox items.
Best regards
Quote from Gaev on July 15, 2019, 11:57 pm@sakismor
It is not clear what you are trying to do ... perhaps you can post the various pieces of your code here.
I
It is not clear what you are trying to do ... perhaps you can post the various pieces of your code here.
I
Quote from sakismor on July 16, 2019, 6:56 amPlease check the code that is having a button. I just pick some variables and I am write it to a file. And from the Listbox try to get all the data with a loop and I put the special character [#13] to change the line.
FileWrite "[PubDir]data\[PICKYEAR]-[PICKMONTH]-[PICKDAY].cal" "All" "" FileWrite "[PubDir]data\[PICKYEAR]-[PICKMONTH]-[PICKDAY].cal" "Append" "K30Car=[K30Car]" FileWrite "[PubDir]data\[PICKYEAR]-[PICKMONTH]-[PICKDAY].cal" "Append" "K30TimeIn=[K30TimeIn]" FileWrite "[PubDir]data\[PICKYEAR]-[PICKMONTH]-[PICKDAY].cal" "Append" "K30TimeOut=[K30TimeOut]" FileWrite "[PubDir]data\[PICKYEAR]-[PICKMONTH]-[PICKDAY].cal" "Append" "K30YesNo=[K30YesNo]" ListBoxSize "K30ListBox" "[ListBoxNum]" Loop "1" "[ListBoxNum]" "[ListBoxNumlock]" ListBoxGetItem "K30ListBox" "[ListBoxNumlock]" "[ListBoxGet]" SetVar "[YPALLHLOI]" "[YPALLHLOI][ListBoxGet][#13]" endloop FileWrite "[PubDir]data\[PICKYEAR]-[PICKMONTH]-[PICKDAY].cal" "Append" "K30YPALLHLOI=[YPALLHLOI]" SetVar "[YPALLHLOI]" ""But the file that I make the listbox items is all together without the special character to split them. Please check the file that made it.
K30Car=ΠΣ1332 ( 2.5 TN) K30TimeIn=21:30 K30TimeOut=08:00 K30YesNo=ΝΑΙ K30YPALLHLOI=ΟΔΗΓΟΣ ΠΥΡΓΟΣ (12863) ΑΔΑΜΟΥ ΧΡΥΣΟΥΛΑ ΤΗΛ 6947273787 ΟΔΗΓΟΣ ΠΥΡΓΟΣ (12863) ΑΔΑΜΟΥ ΧΡΥΣΟΥΛΑ ΤΗΛ 6947273787 ΟΔΗΓΟΣ ΠΥΡΓΟΣ (12863) ΑΔΑΜΟΥ ΧΡΥΣΟΥΛΑ ΤΗΛ 6947273787
Please check the code that is having a button. I just pick some variables and I am write it to a file. And from the Listbox try to get all the data with a loop and I put the special character [#13] to change the line.
FileWrite "[PubDir]data\[PICKYEAR]-[PICKMONTH]-[PICKDAY].cal" "All" "" FileWrite "[PubDir]data\[PICKYEAR]-[PICKMONTH]-[PICKDAY].cal" "Append" "K30Car=[K30Car]" FileWrite "[PubDir]data\[PICKYEAR]-[PICKMONTH]-[PICKDAY].cal" "Append" "K30TimeIn=[K30TimeIn]" FileWrite "[PubDir]data\[PICKYEAR]-[PICKMONTH]-[PICKDAY].cal" "Append" "K30TimeOut=[K30TimeOut]" FileWrite "[PubDir]data\[PICKYEAR]-[PICKMONTH]-[PICKDAY].cal" "Append" "K30YesNo=[K30YesNo]" ListBoxSize "K30ListBox" "[ListBoxNum]" Loop "1" "[ListBoxNum]" "[ListBoxNumlock]" ListBoxGetItem "K30ListBox" "[ListBoxNumlock]" "[ListBoxGet]" SetVar "[YPALLHLOI]" "[YPALLHLOI][ListBoxGet][#13]" endloop FileWrite "[PubDir]data\[PICKYEAR]-[PICKMONTH]-[PICKDAY].cal" "Append" "K30YPALLHLOI=[YPALLHLOI]" SetVar "[YPALLHLOI]" ""
But the file that I make the listbox items is all together without the special character to split them. Please check the file that made it.
K30Car=ΠΣ1332 ( 2.5 TN) K30TimeIn=21:30 K30TimeOut=08:00 K30YesNo=ΝΑΙ K30YPALLHLOI=ΟΔΗΓΟΣ ΠΥΡΓΟΣ (12863) ΑΔΑΜΟΥ ΧΡΥΣΟΥΛΑ ΤΗΛ 6947273787 ΟΔΗΓΟΣ ΠΥΡΓΟΣ (12863) ΑΔΑΜΟΥ ΧΡΥΣΟΥΛΑ ΤΗΛ 6947273787 ΟΔΗΓΟΣ ΠΥΡΓΟΣ (12863) ΑΔΑΜΟΥ ΧΡΥΣΟΥΛΑ ΤΗΛ 6947273787
Quote from Gaev on July 16, 2019, 8:43 pm@sakismor
The problem here appears to be line 10 ... in Windows text files, a new line is represented by a carriage return ([#13]) and a line feed ([#10]) ... so try this ...
SetVar "[YPALLHLOI]" "[YPALLHLOI][ListBoxGet][#13][#10]"Alternatively, if the ListBox does not have hundreds of items you can just do a FileWrite (Append) of each item in the ListBox ... do this before the loop ...
FileWrite "[PubDir]data\[PICKYEAR]-[PICKMONTH]-[PICKDAY].cal" "Append" "K30YPALLHLOI=[#13][#10]"... replace line 10 with ...
FileWrite "[PubDir]data\[PICKYEAR]-[PICKMONTH]-[PICKDAY].cal" "Append" "[ListBoxGet]"... and of course, remove line 12.
The problem here appears to be line 10 ... in Windows text files, a new line is represented by a carriage return ([#13]) and a line feed ([#10]) ... so try this ...
SetVar "[YPALLHLOI]" "[YPALLHLOI][ListBoxGet][#13][#10]"
Alternatively, if the ListBox does not have hundreds of items you can just do a FileWrite (Append) of each item in the ListBox ... do this before the loop ...
FileWrite "[PubDir]data\[PICKYEAR]-[PICKMONTH]-[PICKDAY].cal" "Append" "K30YPALLHLOI=[#13][#10]"
... replace line 10 with ...
FileWrite "[PubDir]data\[PICKYEAR]-[PICKMONTH]-[PICKDAY].cal" "Append" "[ListBoxGet]"
... and of course, remove line 12.

Quote from impactband4u on July 16, 2019, 11:54 pmDownload Pub at www.bgmstudio.co.za
Greetings
Download Pub at http://www.bgmstudio.co.za
Greetings