hello peeps can someone help me with a problem i'm writing a prgramm in procomm plus 32 that has 4 pulldown windows and te content of the 4 pulldown windows are in a textfile(i've done this so that it's easy to make changes when you want to add something)..it succeeded me to fill the 1ste pulldown window i'm using [navigatiesystemen]en [/navigatiesystemen] and i give orders to display everything whats between [navigatiesystemen] and [/navigatiesystemen] in pull down window 1.
so this is what i want:
when you have chosen one of the navigationsystemen in pulldown window 1, then the script should open the targetsfile that is assigned to that navigationsystem. for example if you have chosen hvm3 in the 1ste pulldown window it should display in pulldown window 2 what's between [hmv3] and [/hvm3]and if roadrunner is chosen in pulldown window 1 it should display in pull down window 2 what's between [roadrunner] and [/roadrunner]....
if i add something i 'll do it in the textfile so for example if i want to add a navigationsystem hvm4... so all i have to do is adding between [navigationsystems] and [/navigationsystems]the word hvm4 and add betweeen [targets] and [/targets] the word [hvm4] and [/hvm4] and in [hvm4] and [/hvm4] ill puts the testnames .....and that is then atomatically changed in the script
i've tried to do it myself but with no results...
here i'll give you my script file and the textfile i've made so far
i've not assigned the casses yet.
i've wrote a script with fulllist but i wanted to use a textfile so i'm overwriting the fulllist file( i hope you know what i mean). i mean that i must delte fulllist=.... and stuff it was from the old scriptfile
SCRIPTFILE:
func Fgets_FR : string ; opens function and gives a string back.
param integer bestand ; parameter integer bestand.
string resultstring="" ; string to contain resultstring, declare to be an emty string.
string temp ; string to contain temp.
integer endofline =0 ; integer to contain endofline.
integer karakter ; integer to contain karakter.
integer carret = 13 ; integer to contain carret.
while endofline==0 ; loop while.
if feof 0 ; if end of file.
endofline=1 ; endofline.
else
fgetc bestand karakter ; get karakter from bestand file.
if karakter==carret ; is karakter is equal to carret(13) then end of line.
endofline=1
else
if karakter>32 & karakter<127
strset temp 0 karakter 1 ; coverts an integer to a ascii string.
strcat resultstring temp ; concat. resultstring to temp.
endif
endif
endif
endwhile
return resultstring
endfunc
proc main
string Fname = "H:/voorbeeld.txt" ; File name to be opened.
string FullList1
string FullList2
string Items ; Item selected from list.
string Items1
string Items2
string LineBuffer ; Line read from file.
string searchstring
string inhoudbox1 = ""
string inhoudbox2 = ""
integer Event
integer eindbereikt =0
searchstring = "[NAVIGATIESYSTEMEN]" ; declares searchstring
if fopen 0 Fname READ TEXT ; Open file for read only.
while not feof 0 ; Loop while not end of file.
LineBuffer = fgets_FR (0)
if strcmp LineBuffer searchstring ; if searchstring is equal to linebuffer
searchstring = "[/NAVIGATIESYSTEMEN]" ; declares searchstring
while eindbereikt == 0
if feof 0
eindbereikt=1
else
LineBuffer = fgets_FR (0)
if strcmp LineBuffer searchstring
eindbereikt=1
else
strcat inhoudbox1 LineBuffer ; concat. inhoudbox1 to linebuffer
strcat inhoudbox1 "," ; ends line with a ","
endif
endif
endwhile
exitwhile
endif
endwhile
fclose 0
else
errormsg "Kan file niet vinden `"%s`"." Fname ;kan file niet vinden
endif
termmsg inhoudbox1 ; shows inhoudbox1 on terminal
;the script whats above here is what i wrote new and whats beneeth(down) here is the old fullist script but the size of the comboboxen and dialogbox and text are good for the new script. so what's beneeth must be changed. but i want to solve my problems first and then change what's beneeth(down)
; Display a dialog box with a list of stuff to choose from.
FullList1 = "TARGETS,AN,BMW,VOLVO,ENZOVOORTS"
FullList2 = "TESTS,fantest,audiotest,cdtest,beeldtest"
Items = "NAVIGATIEMODELLEN" ; Set default item.
Items1 = "TARGETS"
Items2 = "TESTS"
dialogbox 0 1 16 676 379 2 "Test Software"
combobox 1 10 24 139 329 DROPDOWNLIST inhoudbox1 Items
combobox 2 172 24 139 329 DROPDOWNLIST Fulllist2 Items1
combobox 3 343 24 139 329 DROPDOWNLIST FullList2 Items2
combobox 4 522 23 139 329 DROPDOWNLIST FullList2 Items2
text 5 43 6 74 11 "Navigatiemodellen" left
text 6 224 6 34 10 "Targets" left
text 7 406 5 30 14 "Tests" left
text 8 570 4 45 12 "Testcases" left
enddialog
while 1
dlgevent 0 Event ; Get dialog event.
switch Event ; Evaluate the event.
case 0 ; No event occurred.
endcase
case 1 ; Check box item selected.
usermsg "`"%s`" selected!" Items
endcase
case 2 ; Check box item selected.
usermsg "`"%s`" selected!" Items1
endcase
case 3 ; Check box item selected.
usermsg "`"%s`" selected!" Items2
endcase
case 4 ; Check box item selected.
usermsg "`"%s`" selected!" Items2
endcase
default ; Exit method selected.
exitwhile ; Exit the while loop.
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL ; Destroy the dialog box.
endproc
TEXTFILE:
this is the textfile that i use so the content of this textfile must be displayed in the pull down windows
[NAVIGATIESYSTEMEN]
ROADRUNNER
HVM3
FIETS
[/NAVIGATIESYSTEMEN]
[TARGETS]
[ROADRUNNER]
BMW COLOR, BMW-COLOR.TXT
BMW MONO, BMW-MONO.TXT
BMW OCN, BMW-OCN.TXT
AN COLOR, AN-COLOR.TXT
AN MONO, AN-MONO.TXT
AN RADNAV, AN-RADNAV.TXT
[/ROADRUNNER]
[HVM3]
OPEL, OPEL.TXT
AUDI C6, AUDI-C6.TXT
AUDI ELISA, AUDI-ELISA.TXT
[/HVM3]
[/TARGETS]
so this is what i want:
when you have chosen one of the navigationsystemen in pulldown window 1, then the script should open the targetsfile that is assigned to that navigationsystem. for example if you have chosen hvm3 in the 1ste pulldown window it should display in pulldown window 2 what's between [hmv3] and [/hvm3]and if roadrunner is chosen in pulldown window 1 it should display in pull down window 2 what's between [roadrunner] and [/roadrunner]....
if i add something i 'll do it in the textfile so for example if i want to add a navigationsystem hvm4... so all i have to do is adding between [navigationsystems] and [/navigationsystems]the word hvm4 and add betweeen [targets] and [/targets] the word [hvm4] and [/hvm4] and in [hvm4] and [/hvm4] ill puts the testnames .....and that is then atomatically changed in the script
i've tried to do it myself but with no results...
here i'll give you my script file and the textfile i've made so far
i've not assigned the casses yet.
i've wrote a script with fulllist but i wanted to use a textfile so i'm overwriting the fulllist file( i hope you know what i mean). i mean that i must delte fulllist=.... and stuff it was from the old scriptfile
SCRIPTFILE:
func Fgets_FR : string ; opens function and gives a string back.
param integer bestand ; parameter integer bestand.
string resultstring="" ; string to contain resultstring, declare to be an emty string.
string temp ; string to contain temp.
integer endofline =0 ; integer to contain endofline.
integer karakter ; integer to contain karakter.
integer carret = 13 ; integer to contain carret.
while endofline==0 ; loop while.
if feof 0 ; if end of file.
endofline=1 ; endofline.
else
fgetc bestand karakter ; get karakter from bestand file.
if karakter==carret ; is karakter is equal to carret(13) then end of line.
endofline=1
else
if karakter>32 & karakter<127
strset temp 0 karakter 1 ; coverts an integer to a ascii string.
strcat resultstring temp ; concat. resultstring to temp.
endif
endif
endif
endwhile
return resultstring
endfunc
proc main
string Fname = "H:/voorbeeld.txt" ; File name to be opened.
string FullList1
string FullList2
string Items ; Item selected from list.
string Items1
string Items2
string LineBuffer ; Line read from file.
string searchstring
string inhoudbox1 = ""
string inhoudbox2 = ""
integer Event
integer eindbereikt =0
searchstring = "[NAVIGATIESYSTEMEN]" ; declares searchstring
if fopen 0 Fname READ TEXT ; Open file for read only.
while not feof 0 ; Loop while not end of file.
LineBuffer = fgets_FR (0)
if strcmp LineBuffer searchstring ; if searchstring is equal to linebuffer
searchstring = "[/NAVIGATIESYSTEMEN]" ; declares searchstring
while eindbereikt == 0
if feof 0
eindbereikt=1
else
LineBuffer = fgets_FR (0)
if strcmp LineBuffer searchstring
eindbereikt=1
else
strcat inhoudbox1 LineBuffer ; concat. inhoudbox1 to linebuffer
strcat inhoudbox1 "," ; ends line with a ","
endif
endif
endwhile
exitwhile
endif
endwhile
fclose 0
else
errormsg "Kan file niet vinden `"%s`"." Fname ;kan file niet vinden
endif
termmsg inhoudbox1 ; shows inhoudbox1 on terminal
;the script whats above here is what i wrote new and whats beneeth(down) here is the old fullist script but the size of the comboboxen and dialogbox and text are good for the new script. so what's beneeth must be changed. but i want to solve my problems first and then change what's beneeth(down)
; Display a dialog box with a list of stuff to choose from.
FullList1 = "TARGETS,AN,BMW,VOLVO,ENZOVOORTS"
FullList2 = "TESTS,fantest,audiotest,cdtest,beeldtest"
Items = "NAVIGATIEMODELLEN" ; Set default item.
Items1 = "TARGETS"
Items2 = "TESTS"
dialogbox 0 1 16 676 379 2 "Test Software"
combobox 1 10 24 139 329 DROPDOWNLIST inhoudbox1 Items
combobox 2 172 24 139 329 DROPDOWNLIST Fulllist2 Items1
combobox 3 343 24 139 329 DROPDOWNLIST FullList2 Items2
combobox 4 522 23 139 329 DROPDOWNLIST FullList2 Items2
text 5 43 6 74 11 "Navigatiemodellen" left
text 6 224 6 34 10 "Targets" left
text 7 406 5 30 14 "Tests" left
text 8 570 4 45 12 "Testcases" left
enddialog
while 1
dlgevent 0 Event ; Get dialog event.
switch Event ; Evaluate the event.
case 0 ; No event occurred.
endcase
case 1 ; Check box item selected.
usermsg "`"%s`" selected!" Items
endcase
case 2 ; Check box item selected.
usermsg "`"%s`" selected!" Items1
endcase
case 3 ; Check box item selected.
usermsg "`"%s`" selected!" Items2
endcase
case 4 ; Check box item selected.
usermsg "`"%s`" selected!" Items2
endcase
default ; Exit method selected.
exitwhile ; Exit the while loop.
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL ; Destroy the dialog box.
endproc
TEXTFILE:
this is the textfile that i use so the content of this textfile must be displayed in the pull down windows
[NAVIGATIESYSTEMEN]
ROADRUNNER
HVM3
FIETS
[/NAVIGATIESYSTEMEN]
[TARGETS]
[ROADRUNNER]
BMW COLOR, BMW-COLOR.TXT
BMW MONO, BMW-MONO.TXT
BMW OCN, BMW-OCN.TXT
AN COLOR, AN-COLOR.TXT
AN MONO, AN-MONO.TXT
AN RADNAV, AN-RADNAV.TXT
[/ROADRUNNER]
[HVM3]
OPEL, OPEL.TXT
AUDI C6, AUDI-C6.TXT
AUDI ELISA, AUDI-ELISA.TXT
[/HVM3]
[/TARGETS]