Statistics: Posted by moneo — Fri Dec 09, 2005 7:40 pm
Code:
if number MOD divisor = 0 then 'number is divisible
Statistics: Posted by Xerol — Fri Dec 09, 2005 4:58 pm
Code:
for i = 2000 to 2017 print i; if i and not -4 then print "Not" else print "Is"next i
Statistics: Posted by Zim — Fri Dec 09, 2005 12:30 pm
Code:
IF berths MOD 2 > 0 THEN berths = berths +1
Statistics: Posted by Guest — Wed Dec 07, 2005 12:48 pm
Statistics: Posted by Guest — Sat Dec 03, 2005 10:17 pm
Code:
berth = int(rnd * 16) + 5 if (berth AND 1) = 1 THEN 'its ODD let berth = (berth - 1) print berth else print "its okay berths even" 'its EVEN end if
Statistics: Posted by Guest — Sat Dec 03, 2005 10:15 pm
Code:
berth = int(rnd * 16) + 5 if (berth AND 1) = 1 THEN 'its ODD let berth = (berth - 1) print berth else print "its okay berths even" 'its EVEN end if
Statistics: Posted by Antoni — Sat Dec 03, 2005 10:45 am
Chances are your file is going to be in the same directory as your executable. All you'd need is the filename in that case. If it's in a subdirectory, then you need the subdir name and the filename (say you have a subdir called "stuff" and a file called "myfile.txt", you'd write this as "stuff\myfile.txt"). Absolute paths are extremely unstable when it comes to another person's computer and in QB, this leads to program crashes.1. how would i find the file if i dont have an exact path?
Yeah...the keyword is "freefile":2. do you mean that next file # available thingy?
Code:
DIM fh AS INTEGERfh = FREEFILEOPEN myfile$ FOR APPEND AS #fhPRINT #fh, "Stuff!"CLOSE fh
Statistics: Posted by Nodtveidt — Sat Dec 03, 2005 12:55 am
That can't be. Post your code so we can take a look......
correct i was just plugin' in 11 as the "value" to show whats happening...
i used berth as my variable..
but it turned all my "berths" to -1..
i had a number of berths like 15, 11, 29...
it set them all to -1
Code:
im confused....:(berth = int(rnd * 16) + 5 if berth AND 1 = 1 THEN 'its ODD let berth = (berth - 1) print berth else print "its okay berths even" 'its EVEN end if
Statistics: Posted by Guest — Sat Dec 03, 2005 12:52 am
Statistics: Posted by moneo — Fri Dec 02, 2005 8:42 pm
Statistics: Posted by Guest — Fri Dec 02, 2005 8:15 pm
Statistics: Posted by Guest — Fri Dec 02, 2005 8:11 pm
Code:
input "enter your ships name"; file$file$ = "boohoo" <<<<exampleopen "c:\xxxx\file$ + ".txt" for append as #1
Code:
open "c:\xxxx" + file$ + ".txt" for append as #1
Statistics: Posted by Nodtveidt — Fri Dec 02, 2005 7:42 pm
okay i tried this but it turns my number toOkay to make something a bit more clear:Basically...If the 0th bit of the value is on, the number is odd, If it's off, the number is even.Code:
IF value AND 1 = 1 THEN ' value is ODDELSE 'value is EVENEND IF
Code:
berth = int(rnd * 16) + 5 <<<minium 5 berths max 20 berthsberth = 11 <<<<example...if 11 AND 1 = 1 then let 11 = (11 - 1)else PRINT "its okay its even"end if
Statistics: Posted by moneo — Fri Dec 02, 2005 7:09 pm
Code:
input "enter your ships name"; file$file$ = "boohoo" <<<<exampleopen "c:\xxxx\file$ + ".txt" for append as #1
Statistics: Posted by Guest — Fri Dec 02, 2005 6:28 pm