Page 1 of 1
Word doen't work. How come?
Posted: Sun Dec 22, 2024 1:13 am
by Randy Walker
This renders zero in both PB ver 5.40 and ver 6.20
So why does Debug not give me 33 ?
Re: Word doen't work. How come?
Posted: Sun Dec 22, 2024 1:16 am
by Randy Walker
Haha haaa I'm such an idiot -- Total I/O error.
Xit1 <> Xit (Duuhhhh)

Re: Word doen't work. How come?
Posted: Sun Dec 22, 2024 1:18 am
by Little John
Use EnableExplicit to avoid mistakes like that.
Re: Word doen't work. How come?
Posted: Sun Dec 22, 2024 1:42 am
by Randy Walker
Little John wrote: Sun Dec 22, 2024 1:18 am
Use
EnableExplicit to avoid mistakes like that.
Yeah, I tried that but EnableExplicit causes me too much confusion.
Re: Word doen't work. How come?
Posted: Sun Dec 22, 2024 9:39 am
by DarkDragon
Randy Walker wrote: Sun Dec 22, 2024 1:42 am
Little John wrote: Sun Dec 22, 2024 1:18 am
Use
EnableExplicit to avoid mistakes like that.
Yeah, I tried that but EnableExplicit causes me too much confusion.
Not having EnableExplicit confused you, too. It just requires you to declare variables correctly.
Re: Word doen't work. How come?
Posted: Sun Dec 22, 2024 12:50 pm
by Quin
Yeah, Explicit made using PB way nicer for me. Once you get used to it it's fairly simple, you just have to declare all your variables before you use them. For globals this is super simple:
In procedures, you use Protected, and I personally tend to declare all needed variables right at the top of the function to avoid scope weirdness:
Code: Select all
Procedure Test()
Protected I, Ret$,
For I = 0 To 10
Ret$ + "meow"
Next
Debug Ret$
EndProcedure
The only thing this makes slightly less convenient are for loops, which is why I really want the := operator, so we can go:
Or even: