Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Dumbist command in db/db pro...

Author
Message
ZomBfied
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 5th Dec 2002 19:07
EndCase. It's kind of redundant. What do you guys think?
Megaman X
21
Years of Service
User Offline
Joined: 21st Oct 2002
Location: Sweden
Posted: 5th Dec 2002 21:48
huh?

I don't suffer from insanity, I enjoy every minute of it.
-- Rogue
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 5th Dec 2002 22:07
Not at all.

Good news everybody! I really am THAT good...
rapscaLLion
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 5th Dec 2002 22:53
No...

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
Kale
21
Years of Service
User Offline
Joined: 8th Sep 2002
Location: United Kingdom
Posted: 6th Dec 2002 01:33
I know in some 'basics' there is no EndCase command to end cases, but i guess it is not hurting anyone and may even create better readability to explictly show where a Case ends

BTW the whole Select/Case command set was added on my request ages ago after i won a compo in easter 2001. The prize was for me to name any command to be included to DBClassic. Which i thought was quite cool! I wish i could name a few for DBPro now

What the flame does not consume, consumes the flame.
------------------------------------------------------------------------
AMD XP2100+, Geforce4Ti 4400, 512Mb DDR, Abit KX7, WinXP Home
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 6th Dec 2002 01:39
What ? They weren't going to orginally have SELECT/CASE command ? Now that would have been bad!

Good news everybody! I really am THAT good...
Kangaroo2
21
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 6th Dec 2002 10:48
obviously multiple commands that do the same thing are semi-redundant, such as the 'cd' and 'set dir' commands. There are other examples which I noticed whilst flicking through the manual. Guess different people prefer different ways

* If the apocalypse comes, email me *
Jetmech
21
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Dayton Ohio
Posted: 6th Dec 2002 14:31
"dumbist"?

Yarbles
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Toronto
Posted: 6th Dec 2002 15:42
Dumbist: Somebody who champions the rights of the Dumb??
(Either that or somebody who can't spell "Dumbest")

The Yellow Jester does not play but gently pulls the strings
And smiles as the puppets dance in the court of the Crimson King.
ZomBfied
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 6th Dec 2002 18:46
Haha Yeah. That's what I meant! I'm a champion of Dumbism! Honestly I've never spelled dumbest before,In fact I didn't know it was a real word (like "mostest") But if you're gonna make a mistake you should do it in a public forum for maximum embarrassment.

It's great that they have the whole case thing. I use it all the time, but one of the cool things about it in vb or other basics is that you can have multiple conditions with fewer lines of code. I mean if your going to have to say
select
case
bla bla bla
endcase
endselect
you might as well have a string of if/endifs, there's less code. The only advantage is that there is a case default so if you have a lot of conditions you can save yourself some time.
You don't need an endcase command because it's ALWAYS followed by a case or by endselect. Just make the next case or endselect statement terminate the case. Endselect should be optional. It's like the LET command. Let a=5.

rapscaLLion
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 6th Dec 2002 23:21
I find "EndCase" To be dumb, but not EndSelect. So I agree with ZomBfied on that one.

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
Jetmech
21
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Dayton Ohio
Posted: 7th Dec 2002 00:28
lol Sorry, I truly thought you were spelling it that way on purpose as a joke!!!!

but hey.... on a bad day, I'd have trouble spelling "a".

Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 7th Dec 2002 03:31
i'm sorry but the dumbest command in DarkBasicPro as was in its predessor ...
LeeBamber()
you will NEVER find any possible use for it as it really doesn't do anything - feel free to try it.
I have a selection more as most here do - I'm sure we can figure out which of all of them is the actually overall most useless command

Anata aru kowagaru no watashi!
Asheron
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location:
Posted: 7th Dec 2002 04:03
LeeBamber() is very useful. Lets say you are writing a game in an insane asylum then for the text to put in the patients chat boxes you just tye it in and there ya go

Real time skinning for your models. PowerPaint3d coming soon.
rapscaLLion
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 7th Dec 2002 19:22
it prints text to the screen... I rather liked it.

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
Kale
21
Years of Service
User Offline
Joined: 8th Sep 2002
Location: United Kingdom
Posted: 7th Dec 2002 19:28
obviously lee is a red dwarf fan judging by the 'what the smegiddy smeg have you smegging done?' text in leebamber() to the planet potter demo!

What the flame does not consume, consumes the flame.
------------------------------------------------------------------------
AMD XP2100+, Geforce4Ti 4400, 512Mb DDR, Abit KX7, WinXP Home
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 8th Dec 2002 10:00
lol i kinda find it hard for anyone not to like Red Dwarf

Anata aru kowagaru no watashi!
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Dec 2002 12:27
Glab you like our little British production - though I think they kinda spoiled it when they substituted graphic sequences for the models when it was exported.
Kangaroo2
21
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 10th Dec 2002 18:10
yeah but Cochanski is FIT

I love talkie toaster and 'tongue tied'

* If the apocalypse comes, email me *
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Dec 2002 18:25
My favourite bit was the intro with ace rimmer and the nazis - sky surfing on a croc. That one had me crying with laughter.

Oh, and to get back on topic: DIR or DRIVELIST
Whats the point of these commands - For all that they do, you would be better off using explorer.
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 11th Dec 2002 07:13
I thought the hard light drive idea was clever in RD

Kale
21
Years of Service
User Offline
Joined: 8th Sep 2002
Location: United Kingdom
Posted: 11th Dec 2002 14:43
the 'tongue tied' song recorded by cat's dream recorder was well funny, i think i nearly soiled myself watching that! also when Lister shags Rimmer's mum (polymorph) and she mentions the alphabetty spagetti involved, LMAO.. i was almost crying with laughing!

What the flame does not consume, consumes the flame.
------------------------------------------------------------------------
AMD XP2100+, Geforce4Ti 4400, 512Mb DDR, Abit KX7, WinXP Home
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 11th Dec 2002 16:55
Getting back to the original post (not that I mind the Red Dwarf discussions) you realise that Select...Case and If...EndIf are not necessarily interchangable IE:-

Select A
Case 1 : Do Something Here : EndCase
Case 2 : Do Something Else Here : EndCase
EndSelect

Will not bother with the second case statement if the first is true, whereas:-

If A = 1 Then Do Something Here
If A = 2 Then Do Something Else Here

Will always do both If statements.

The advantage here is (potentially) for speed, particularly if you structure your case statements such that the most common cases are in the first case blocks.

Note also that in the First 'If' you could change A to 2 and it would then execute the second 'If', but the Select...Case would not.

Incidentally I think the Red Dwarf where Kryten becomes human, the bit 'Is this normal sir'....'What, Taking pictures of it and showing them to your mates! NO ITS NOT NORMAL!' , Brilliant! Nothing else comes close....
ZomBfied
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 11th Dec 2002 18:26
I like the old one where they first find Kryten. "This is my mate, Ace. Did I happen to mention he's realy incredibly brave..."

I understand the advantages of the select/case structure, but you don't need the "endcase" statement, because every case is terminated by either the next case or by the endselect statement.
It should look like this:

select bla
case bla
do this
case < blabla
do that
endselect

Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 12th Dec 2002 10:42
Um, I have no opinion on the EndCase thing, I have come across both variations before and really do not have a problem with either.

Using EndCase means a bit more typing, but from a coding standards point all blocks should be terminated (except If..Then, but thats a legacy thing). Case is a bit odd as you never find it outside of the Select..Endselect block (I don`t think there is anything else quite like that in Basic).
ZomBfied
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 12th Dec 2002 18:37
There is 1 thing I can think of. "Else." EndCase is like if you had an "EndElse" statement.

ZomBfied
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 12th Dec 2002 22:58
There is 1 thing. "Else." Imagine if they had an "EndElse" command. That's what "EnCase" is like.

ZomBfied
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 12th Dec 2002 23:56
Woah Deja Vous.

Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 13th Dec 2002 13:59
Yes that fits, well done, give yourself a pressie.

I see you hit the 25 posts per page thing and thought your post had been lost, I did that 4 times in one thread before I realised what was happening!
ZomBfied
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 13th Dec 2002 19:35
Hah yep. That's what happened.

Dazzag
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Cyprus
Posted: 14th Dec 2002 04:32
As to the select-case being faster than multiple if's because it doesn't perform the other case checks once it hits it's criteria....

Hmmm, hopefully they have updated the code on the select-case, because the original DB1 select-case was rubbish. If I remember rightly on speed checks (it was a long time ago when I wrote them) it was slower than using multiple IFs. As it happens, if you put a label at the end of the select, and got all cases to GOTO the label when they were done, then it was faster than the IFs. Until you did the same to the IFs.

So multiple IF's with GOTO's on the end of them to fake the performance of a SELECT-CASE was the fastest method. I could live with this if they fixed the original problem : ie. it was obviously processing the check on each case, even though the check had been satisfied earlier (the putting a goto on the end of each case to find it ran faster pretty much proves this). I reported this and was told it was tough, and to use the goto on the end of each case line. Sheesh. Never used it again in DB.

If someone has the time though, do some checks in DBP. I haven't unfortuantly Would be nice to know they have fixed that problem.

Oh, and they did originally ship DB without SELECT-CASE. Came along yonks later thanks to compo. They didn't pick up on all the points we made about case though....

Cheers

Oh, and the funniest Red Dwarf episode was the 2nd one. Where he meets the cat, and the history of the cats is explained. Funny. And has anyone ever seen the photo for the cast of the American pilot episode? Totally amusing, must hunt it down.... safe to say they totally cocked it up, didn't get the idea, and it didn't ever get off the ground. Or did it? Never saw it over here.

I am 99% probably lying in bed right now... so don't blame me for crappy typing
Kangaroo2
21
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 14th Dec 2002 13:02
I know it was mentioned a while ago but the explorer type commands are useful for making apps, and also being able to choose a directory for save games, check if one exists, if not make one etc.

* If the apocalypse comes, email me *
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 16th Dec 2002 15:38
Dazzag - Thats precisely why I put that '(potentially)' in the earlier reply, its all too dependant on how the compiler interprets the statement, next time I`m using a select-case in a time sensitive piece of code I will do some timing tests and see.

Login to post a reply

Server time is: 2024-05-02 07:59:15
Your offset time is: 2024-05-02 07:59:15