Page 1 of 2
[Implemented] I miss these features
Posted: Thu Dec 16, 2004 7:48 am
by akee
Fred,
Please give us a NOT operator... I miss doing...
Is there a spring feature for the StatusBar? Example...
would maximize the field according to the remainder window width
Any chance to have C like math syntax?
Posted: Thu Dec 16, 2004 10:15 am
by Psychophanta
Hello,
First and 3rd requests are only syntax matter.
You can do:
And i've tested that the 0 comparing is as fast as ASM
And for the 3rd req, you can do a+10 instead a+=10, and b+1 instead b++
I'd prefer the syntax, power and flexibility of the C "for" loops as an alternative "for-next" loops syntax in PB, don't you?

Re: I miss these features
Posted: Thu Dec 16, 2004 10:32 am
by Num3
akee wrote:Fred,
Please give us a NOT operator... I miss doing...
Posted: Thu Dec 16, 2004 10:47 am
by akee
Psychophanta wrote:Hello,
First and 3rd requests are only syntax matter.
You can do:
And i've tested that the 0 comparing is as fast as ASM
And for the 3rd req, you can do a+10 instead a+=10, and b+1 instead b++
I'd prefer the syntax, power and flexibility of the C "for" loops as an alternative "for-next" loops syntax in PB, don't you?

hey thanks for the 3rd req tip...
yes i agree with you... however this is basic and for(a=0;a<10;a++) might create a hybrid language...

Re: I miss these features
Posted: Thu Dec 16, 2004 10:56 am
by akee
Num3 wrote:akee wrote:Fred,
Please give us a NOT operator... I miss doing...
Well it seems that PB has smart reads... I remember if coding...
open some file handle = 0
repeat
a = readsomething(0) <- this will trigger run-time "input past end" error if the file is empty.
until eof(0)
close (0)
thanks for the tip
Posted: Thu Dec 16, 2004 12:00 pm
by Num3
I use that snippet o code all the time when i need to read an entire file, never had a problem!
Posted: Thu Dec 16, 2004 2:19 pm
by LarsG
if the file is empty, then you might get a runtime error when using the Repeat loop... otherwise, it shouldn´t be a problem.. (as long as the file exists)
Posted: Thu Dec 16, 2004 6:01 pm
by Justin
I second the not operator, yes is only about syntax but it will be hard to find a language that does not have it.
but please use a single letter otherwise there won't be much difference in typing
while !EOF()
wend
Posted: Sun Dec 19, 2004 1:40 pm
by geoff
but please use a single letter otherwise there won't be much difference in typing
NOT is clearer when you are reading a listing.
While NOT Eof(1)
While ! Eof(1)
Sometimes I used to type | instead of ! in another language, then spend ages wondering why the code would not work. In some fonts the difference was only 1 pixel on the screen.
Posted: Sun Dec 19, 2004 6:16 pm
by blueznl
readability is all, it's simply easier to read:
if not eof(...)
if eof(...)
than it is
if eof(...)=0
if eof(...)<>0
Posted: Sun Dec 19, 2004 8:28 pm
by PB
> if the file is empty, then you might get a runtime error when using the Repeat loop
You don't. Like Num3 said, I also use it that way and never get a runtime
error, even with 0-byte files.
Posted: Sun Dec 19, 2004 9:27 pm
by Num3
And in good programming you should always check the file size, before opening it, no need to waste cpu when there's nothing to read:
Code: Select all
file.s="myfile.txt"
If FileSize(file)>0
If ReadFile(0,file)
Repeat
Debug ReadString()
Until Eof(0)
EndIf
EndIf
Posted: Mon Dec 20, 2004 4:18 am
by Shannara
akee wrote: however this is basic and for(a=0;a<10;a++) might create a hybrid language...

However, the only thing basic about purebasic is the word "basic" in the title

We already have a "hybrid" language, why not continue adding keywords?

Posted: Mon Dec 20, 2004 5:23 am
by akee
Hmmm... How about some pointers to the Status Bar spring feature that wouuld resize itself to the width of the window...?
sigh!
Posted: Tue Mar 29, 2005 6:36 am
by akee
Did some Pure Basic file coding these last few days... Still feels kinda naked without the NOT operator...
