Posted: Mon May 13, 2002 1:25 pm
Restored from previous forum. Originally posted by willinyork.
Hi there. I am having some trouble with strings
Basically, I have a file which consists of one large string like this:
VOL10199VOL20147VOL301100VOL401100VOL50121VOL6017VOL701100VOL801100
and this string should break down like this:
VOL101 99 VOL201 47 VOL301 100 VOL401 100 VOL501 21 VOL601 7 VOL701 100 VOL801 100
the "vol101" etc are the "dividers" in the file. The numbers inbetween each divider could be either 1, 2, or 3 digits long. Is it possible to read the value between the dividers into some variables? I wrote some code like this:
vol101start=FindString(qlbfile$,"VOL101",0)+6
vol201start=FindString(qlbfile$,"VOL201",0)+6
vol101end=vol201start-1
sound101vol$=Mid(qlbfile$,vol101start,vol101end)
sound101vol=Val(sound101vol$)
but it closes my app when I open a window which displays the value of "sound101vol". Likewise it closes the PB debugger if I open the "display variables" window.
Any advice would be appreciated, I am very confused!
Hi there. I am having some trouble with strings
VOL10199VOL20147VOL301100VOL401100VOL50121VOL6017VOL701100VOL801100
and this string should break down like this:
VOL101 99 VOL201 47 VOL301 100 VOL401 100 VOL501 21 VOL601 7 VOL701 100 VOL801 100
the "vol101" etc are the "dividers" in the file. The numbers inbetween each divider could be either 1, 2, or 3 digits long. Is it possible to read the value between the dividers into some variables? I wrote some code like this:
vol101start=FindString(qlbfile$,"VOL101",0)+6
vol201start=FindString(qlbfile$,"VOL201",0)+6
vol101end=vol201start-1
sound101vol$=Mid(qlbfile$,vol101start,vol101end)
sound101vol=Val(sound101vol$)
but it closes my app when I open a window which displays the value of "sound101vol". Likewise it closes the PB debugger if I open the "display variables" window.
Any advice would be appreciated, I am very confused!