| View previous topic :: View next topic |
| Author |
Message |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Fri Apr 16, 2004 11:24 pm Post subject: I'm stumped on the STRING not reading correctly.. |
|
|
The best way I can explain is with an example that doesn't create the error when its run (if that makes any sense - for some odd reason I can't re-create the error in this example, but it explains the error)
| Code: | DIALOG CREATE,testing,-1,0,389,190
DIALOG ADD,BITLIST,listbox,15,6,378,115,,,DBLCLICK,MULTI
DIALOG SHOW
DIRECTORY create,c:\testing\this\is\example\folder
#resource add,bitmap,C:\VDS5\bitlist.bmp
LIST CREATE,1
LIST CREATE,2
LIST LOADTEXT,1
"c:\testing\this\is\example\folder\just-a-test.txt
list append,listbox,@ITEM(1)|#bitlist.bmp
:EVLOOP
WAIT EVENT
GOTO @EVENT()
:listboxDBLCLICK
rem %s = @trim(@dlgtext(listbox))
%s = @path(@dlgtext(listbox))
info %s
SHELL OPEN,%s,wait
goto evloop
:close
LIST close,1
LIST close,2
exit |
It something simple to do with that bitlist BMP prolly, maybe you have the simple solution (I'm really stumped this time )
| my original program ERROR wrote: | | Windows cannot find 'c:\testing\this\is\example\folder\' Make sure you typed the name correctly, and then try again. To search for file, click the Start button, and then click Search. |
One time I seen 2 funny square box symbols (maybe its a carraiage return or line feed quirk that can be fixed with @CHR or something ???
Thanks...please help me  |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Sat Apr 17, 2004 3:17 am Post subject: |
|
|
I'm not sure if this is your problem or not..but I believe you need to create each directory before creating subfolders for it..like:
| Code: |
DIRECTORY CREATE,c:\testing
DIRECTORY CREATE,c:\testing\this
DIRECTORY CREATE,c:\testing\this\is
etc.
|
_________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Sat Apr 17, 2004 3:18 am Post subject: |
|
|
Nope ya don't, sorry should have tested first. _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Sat Apr 17, 2004 3:38 am Post subject: |
|
|
Thanks for trying, but now I have found exactly whats wrong and maybe you can help me fix it.
Heres whats happening:
I found when I 'LIST COPY' the string into the clipboard, and then paste it into notepad, it has a un-wanted carriage return and cause's VDS to think it has 1 extra unknown charactor.
*** I noticed something was wrong when I had trouble getting @strdel() and @strins() refining the long path string... (I use them a lot)
All I have to do is figure out how to strip the last charactor(carriage return).
I tried %t = @trim(string) . . . . . but it don't strip it
I seen someone else here a few weeks ago with same problem, and can't find the solution with VDSworld search
Will VDS5 ever find it in its heart to forgive me * Please help  |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Sat Apr 17, 2004 4:05 am Post subject: |
|
|
Still not real sure, but a couple things to check.
Make sure there is no extra space at the end of your LOADTEXT line("c:\testing\this\is\example\folder\just-a-test.txt ), I know there's a problem with that when pasting from the forum.
Although I rarely use VDS5 I don't think you should use @DLGTEXT on a BITLIST, try @ITEM() like a regular list.
Hope that helps. _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Sat Apr 17, 2004 4:14 am Post subject: |
|
|
heres what I'm experimenting with right now:
| Code: | %%itembox_selected = @trim(@dlgtext(itembox1))
%s = @path(%%itembox_selected)
%%pos = @pos(@CHR(10),%s)
info %%pos
%u = @strdel(%s,%%pos,%%pos)
%q = @strdel(%u,%%pos,%%pos)
info %u
LIST clear,2
LIST append,2,%u
LIST copy,2
SHELL OPEN,%u,wait |
I been (testing)switching from:
@CHR(13) carriage return
@CHR(10) line feed
And the both keep finding at @POS number zero position, so it acts like there several needs deletec at the 1st of the line, weird so far  |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Sat Apr 17, 2004 4:18 am Post subject: |
|
|
| vtol wrote: |
I been (testing)switching from:
@CHR(13) carriage return
@CHR(10) line feed
And the both keep finding at @POS number zero position, so it acts like there several needs deletec at the 1st of the line, weird so far  |
When @POS returns 0, that means it wasn't found in the string. If it was found in the string, it'd be in position 1 through the amount of characters in the string.
I see you are still using @DLGTEXT, you might want to change this to see if it's your problem. _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Sat Apr 17, 2004 4:24 am Post subject: |
|
|
your exactly right and i was wondering about that, but I guess I was so excited to get it fixed by deleting POS zero...
@dlgtext() was just in the example I posted here, in my original program(that really has error) I get the items from loadfile text file that was sorted and created in an earlier stage of my program.
Hey I really appreciate you trying to help
EXAMPLE of carriage return problem: (when pasted into notepad)
| NotePad from paste wrote: | c:\this\is just\a\example\of my problem.txt
| <------ cursor blinks here |
So this tells me that something needs striped from the string (sense I used RUN cmd.exe DIR... to get all the paths  |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Sat Apr 17, 2004 4:30 am Post subject: |
|
|
If you can't get the problem fixed, you might post your actual code, or if you don't want it public, maybe e-mail it to me and see if I can spot the error.
Hard to fix an example that doesn't give an error  _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Sat Apr 17, 2004 4:33 am Post subject: |
|
|
Realistically if the problem is always there, you could just try deleting the last character:
| Code: |
%%fixed_text = @STRDEL(%%text_to_fix,@LEN(%%text_to_fix),@LEN(%%text_to_fix))
|
_________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Sat Apr 17, 2004 4:47 am Post subject: |
|
|
Nop, I tried that 1st a few hours ago, but I tried yours because is looked so much better than my 3 lines - hehe
But you know what, you solved my problem...
| SnarlingSheep wrote: | | I see you are still using @DLGTEXT, you might want to change this to see if it's your problem. |
Thats it!
Because way earlier in my big massive file man handling processing humungus program lines I think it the TEXT files from @DLGTEXT() (which I changed to that method about the time the trouble occured)
And if you think about it, it makes sense, the @dlgtext grabs it from the listbox, which the items have be infected with invisble line break code.
Awesome, thank you very much...
I'll fix it tomorrow, thanks again Snarling . . . your a genious Sheep
POST is resolved - never use @DLGTEXT() if Shell Open is used  |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Sat Apr 17, 2004 4:50 am Post subject: |
|
|
lol, glad to help. _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Sat Apr 17, 2004 4:53 am Post subject: |
|
|
Use a larger hammer on me next time and we'll get it solved faster
Thanks again.. |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Sat Apr 17, 2004 4:54 am Post subject: |
|
|
| vtol wrote: |
POST is resolved - never use @DLGTEXT() if Shell Open is used
|
That should be never use @DLGTEXT() on a list  _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Sat Apr 17, 2004 6:39 am Post subject: |
|
|
Take the contents of the list and place it into a variable... Then try the
code below. If it works, then use CLIPBOARD SET to transfer the resulting
data in the variable to the clipboard.
%%Text is the variable holding the contents of the list.
| Code: | If @equal(@asc(@substr(%%Text,@len(%%Text),@len(%%Text))),10)
%%Text = @substr(%%Text,1,@fsub(@len(%%Text),1))
End
If @equal(@asc(@substr(%%Text,@len(%%Text),@len(%%Text))),13)
%%Text = @substr(%%Text,,@fsub(@len(%%Text),1))
End
If @equal(@asc(@substr(%%Text,@len(%%Text),@len(%%Text))),13)
%%Text = @substr(%%Text,,@fsub(@len(%%Text),1))
End |
_________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|