Just starting out? Need help? Post your questions and find answers here.
infratec
Always Here
Posts: 6874 Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany
Post
by infratec » Sat Nov 21, 2020 12:52 pm
collectordave wrote: With a simple comparison they are not the same.
If String1 = String2
debug "Same"
endif
You should compare the debug ouput 'optical' not via program
What is the difference?
collectordave
Addict
Posts: 1309 Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal
Post
by collectordave » Sat Nov 21, 2020 1:50 pm
When both are debugged they look exactly the same.
CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
#NULL
Addict
Posts: 1440 Joined: Thu Aug 30, 2007 11:54 pm
Location: right here
Post
by #NULL » Sat Nov 21, 2020 1:53 pm
Code: Select all
ShowMemoryViewer(@s, Len(s) * SizeOf(Character))
BarryG
Addict
Posts: 3324 Joined: Thu Apr 18, 2019 8:17 am
Post
by BarryG » Sat Nov 21, 2020 1:57 pm
When I copied your code (from your first post) and pasted it into the IDE, I get extra hidden copied characters before and after most slashes. This would be the cause of your problem, and are maybe not showing in the Debug Output because they are hidden. It would also explain why GetCurrentDirectory() is finding the file, because it won't have these extra hidden characters. So yeah, PureBasic is working as intended because the second example is definitely (and correctly) not finding the file specified.
collectordave
Addict
Posts: 1309 Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal
Post
by collectordave » Sat Nov 21, 2020 2:56 pm
Hi
Just used the show memory and can see the hidden characters.
The question then is why is PureBasic adding these extra characters when creating a string?
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
mk-soft
Always Here
Posts: 5405 Joined: Fri May 12, 2006 6:51 pm
Location: Germany
Post
by mk-soft » Sat Nov 21, 2020 3:41 pm
Is a copy paste error with invisible characters.
Possibly the source of the string is not in the correct BOM format. If you write the String Manuel, there are no special characters in it.
The PB editor should always be set to UTF8.
collectordave
Addict
Posts: 1309 Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal
Post
by collectordave » Sat Nov 21, 2020 4:12 pm
Hi
The editor is set to UTF8 and the string is simply assigned.
String = "My String" etc
Cd
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
#NULL
Addict
Posts: 1440 Joined: Thu Aug 30, 2007 11:54 pm
Location: right here
Post
by #NULL » Sat Nov 21, 2020 6:22 pm
But you probably didn't type the path but instead copied it from some other application that uses a weird format.
infratec
Always Here
Posts: 6874 Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany
Post
by infratec » Sat Nov 21, 2020 6:27 pm
If the length is different, but they look identicall, then there are hidden characters.
Use ShowMemoryViewer() to see the difference.
You need to set breakpoints, because you can only open one MemoryViewer.
RASHAD
PureBasic Expert
Posts: 4663 Joined: Sun Apr 12, 2009 6:27 am
Post
by RASHAD » Sat Nov 21, 2020 6:29 pm
@collectordave
Try to use SetCurrentDirectory(Directory$) to your path piece by piece to see where that function stopped working
Then post that part
Egypt my love
collectordave
Addict
Posts: 1309 Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal
Post
by collectordave » Sun Nov 22, 2020 5:44 am
Thanks to all.
Been working through all the suggestions and think I have found the problem.
When writing that particular application I was using a lot of long path names.
So I copied them all to TextEdit so I could pick each one as I needed it.
It seems that TextEdit added the hidden characters but of course nothing was apparent visually.
I have now retyped every path name manually and it works.
You live & learn.
Who was it that said you make less mistakes with experience and you gain experience by making mistakes?
So true.
Kind regards
CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.