Qbasicnews.com
April 03, 2020, 07:10:52 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: 1 [2]
  Print  
Author Topic: Simple operator for returning larger of two numbers?  (Read 5434 times)
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #15 on: May 03, 2006, 11:47:10 AM »

Quote from: "cha0s"
he didnt use iif because its fb, na_th_an. #define is fb specific as well :lol:


I know, what I don't understand is why the hell people keep dismissing fb in favour of an outdated, crappy, bad-coded and über-cheesy compiler for an outdated, crappy, bad-coded and über-cheesy operating system which is not supported anymore Cheesy
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Anonymous
Guest
« Reply #16 on: May 03, 2006, 01:42:53 PM »

@wallace:

Quote
Simple to do, was just hoping to avoid using a function call for something that would need to be called several thousand times per run period.



@nath:
fear?:p
Logged
stylin
Ancient QBer
****
Posts: 445


« Reply #17 on: May 03, 2006, 06:05:43 PM »

Quote from: "na_th_an"
Quote from: "cha0s"
he didnt use iif because its fb, na_th_an. #define is fb specific as well :lol:


I know, what I don't understand is why the hell people keep dismissing fb in favour of an outdated, crappy, bad-coded and über-cheesy compiler for an outdated, crappy, bad-coded and über-cheesy operating system which is not supported anymore Cheesy

Don't diss DOS, this is a QBasic forum, of course people are going to want to know about QBasic techniques, and dismiss others. :wink:
Logged

stylin:
red_Marvin
Na_th_an
*****
Posts: 1509



WWW
« Reply #18 on: May 04, 2006, 05:56:37 PM »

Wouldn't a qb custom made IIf be like:
Code:
decalre function qbiif (criteria, iftrue, iffalse)

function qbiif (criteria, iftrue, iffalse)
  if criteria<>0 then
    qbiif=iftrue
  else
    qbiif=iffalse
  end if
end function


Tiredness+Caffeine=Brainmash and might make this post irrellevant...
Logged

/post]
Anonymous
Guest
« Reply #19 on: May 04, 2006, 06:37:04 PM »

Yeah, or you could make it into a function!!


lmfao!!
Logged
red_Marvin
Na_th_an
*****
Posts: 1509



WWW
« Reply #20 on: May 04, 2006, 06:40:41 PM »

Of course, but my example isn't tied to this particular situation.
Logged

/post]
Anonymous
Guest
« Reply #21 on: May 04, 2006, 07:55:26 PM »

dude this is the last time i'm saying it, i don't carehow many MORE people post functions here

Quote from: "Dude Who Started The Topic!!!1"
Simple to do, was just hoping to avoid using a function call for something that would need to be called several thousand times per run period.
Logged
red_Marvin
Na_th_an
*****
Posts: 1509



WWW
« Reply #22 on: May 04, 2006, 08:26:54 PM »

Dude, I don't care if you care or not.
I only tried to help by adding another solution.
That and my function would provide some portability between qb/fb.
Logged

/post]
Anonymous
Guest
« Reply #23 on: May 04, 2006, 08:38:21 PM »

my mistake, you know i didn't even realize it was an "iif" function and not an "greater than" function. yes that function would essentially be fb's "iif", albeit muchh slower because of function overhead (and because qb is like 100x slower than fb anyways :p)

sorry! :oops:
Logged
red_Marvin
Na_th_an
*****
Posts: 1509



WWW
« Reply #24 on: May 05, 2006, 07:41:54 AM »

No problem ^^
Logged

/post]
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!