Search found 103 matches
- Jun 28, 2023 15:45
- Forum: Beginners
- Topic: Recover Losses Problem
- Replies: 12
- Views: 2055
Re: Recover Losses Problem
#include "crt/math.bi" dim as single f = 1.4 dim as single ceiled = ceilf(f) '' ceilf for singles, ceil for doubles Print Using "ceilf(&) = &"; f; ceiled You'll need to compile with -l m on Linux because it's dumb like that :D I copied and pasted your code adeyblue and i...
- Jun 28, 2023 15:40
- Forum: Beginners
- Topic: Recover Losses Problem
- Replies: 12
- Views: 2055
Re: Recover Losses Problem
Try this example and you'll see that CInt is not usable in your case Dim value As Integer value = CInt(1.4) print value,"should be 2" value = CInt(1.5) print value,"should be 2" value = CInt(1.6) print value,"should be 2" print value = CInt(2.4) print value,"shoul...
- Jun 26, 2023 19:07
- Forum: General
- Topic: Is This The Right Forum to talk about improving Jokes With ChatGPT?
- Replies: 1
- Views: 320
Is This The Right Forum to talk about improving Jokes With ChatGPT?
Hi! " I love to say Hi! The YEAR 2023 has brought us ARTIFICIAL INTELLIGENCE! Wow and I'm Impressed! I'm Triopstor From Triops(The Pet that decides to eat it's kind after 5 days so you should only hatch 1 egg at a time and they have a life expectancy of 90 days.) Burn the candle at both ends - ...
- Jun 26, 2023 16:01
- Forum: Beginners
- Topic: Recover Losses Problem
- Replies: 12
- Views: 2055
Re: Recover Losses Problem
Okay Guys!
But what about CINT in FreeBASIC? Is that handy here? Is that the same as EXCEL for CEILING? Or is it ROUNDUP?
I'm trying to convert an EXCEL workbook to FreeBASIC in case you didn't know.
Thanks Again, Triopstor.
But what about CINT in FreeBASIC? Is that handy here? Is that the same as EXCEL for CEILING? Or is it ROUNDUP?
I'm trying to convert an EXCEL workbook to FreeBASIC in case you didn't know.
Thanks Again, Triopstor.
- Jun 26, 2023 15:57
- Forum: Beginners
- Topic: Recover Losses Problem
- Replies: 12
- Views: 2055
Re: Recover Losses Problem
I'm not sure about "if frac(s1>e1-006." Would it be "if frac(s1>e1-0.001?" 1e-006 means 0.000001. e1 variable is not involve here. This test is just to avoid an issue when s1 is an integer/whole number Sorry. That's a little funny. I thought SARG that you misspelled a variable. ...
- Jun 26, 2023 0:29
- Forum: Beginners
- Topic: Recover Losses Problem
- Replies: 12
- Views: 2055
Re: Recover Losses Problem
I don't have excel , but I have tested this against some excel ceiling examples on the net. #define dmod(x,y) (y)*Frac((x)/(y)) #define ceiling(num,n) (num) +(n) -dmod((num),(n))+iif((n)>0,iif((num)<0,-(n),0),0) print ceiling(210.67,1) print ceiling(10,3) print ceiling(32.25,.1) print ceiling(-32.2...
- Jun 26, 2023 0:23
- Forum: Beginners
- Topic: Recover Losses Problem
- Replies: 12
- Views: 2055
Re: Recover Losses Problem
Maybe it's what you need. dim as integer r1=800,e1,d12=600,g12=70 dim as single s1 s1=r1*100/d12/g12 if frac(s1)>1e-006 and frac(s1)<0.5 then s1+=1 ''s1=s1+1 End If e1=s1 ' print e1 sleep That looks very good SARG! Thanks for the help! I'm not sure about "if frac(s1>e1-006." Would it be &...
- Jun 25, 2023 16:49
- Forum: Beginners
- Topic: Recover Losses Problem
- Replies: 12
- Views: 2055
Recover Losses Problem
Hi! I want the best method of code to recover losses. Let R1 equal the losses to recover, which is 800 pennies. Let D12=the return price of horse racing or European Roulette on Dozens/Columns, which is $6.00 or 600 pennies. Let G12 equal 70% recovery of losses(R1) of instead of wagering 100% recover...
- May 21, 2023 17:49
- Forum: Beginners
- Topic: QB45 to FreeBASIC Runtime Error Codes
- Replies: 7
- Views: 959
Re: QB45 to FreeBASIC Runtime Error Codes
Thanks to Everyone.
I thought I was going crazy for a while. I'll download QB 4.5 on to my newest computer and compile the program in QB 4.5
Then try to shell to the .EXE program via the FreeBASIC 64 bit version I'm using.
Do 32-bit executable files work with a windows 10 operating system?
I thought I was going crazy for a while. I'll download QB 4.5 on to my newest computer and compile the program in QB 4.5
Then try to shell to the .EXE program via the FreeBASIC 64 bit version I'm using.
Do 32-bit executable files work with a windows 10 operating system?
- May 19, 2023 22:49
- Forum: Beginners
- Topic: How to use RND and RANDOMIZE TIMER
- Replies: 4
- Views: 1456
Re: How to use RND and RANDOMIZE TIMER
Thank You for the code deltarho and explaining why RANDOMIZE TIMER can be improved upon.
- May 19, 2023 22:40
- Forum: Beginners
- Topic: QB45 to FreeBASIC Runtime Error Codes
- Replies: 7
- Views: 959
QB45 to FreeBASIC Runtime Error Codes
Hello I don't understand what is wrong with the Quick Basic 4.5 code. #Lang "QB" DECLARE SUB READ.LINK.DAT() 'LINK.DAT GLOBAL VARIABLES COMMON SHARED TDir$, Year1$, DR$, RE$ '*** "VERIFY" GLOBAL VARIABLES *** COMMON SHARED COL(), ROW(), V$(), D$(), I$(), R$() COMMON SHARED SP2, S...
- May 01, 2023 6:42
- Forum: Beginners
- Topic: How to use RND and RANDOMIZE TIMER
- Replies: 4
- Views: 1456
Re: How to use RND and RANDOMIZE TIMER
Big thanks to you Jeff! I put Randomize Timer at the very beginning of my program and it works! And I did this as below for my testing routine: DIM SHARED AS LONGINT X1,X2,X3,X4 DIM SHARED AS DOUBLE N1 RANDOMIZE TIMER FOR X4=1 TO 20 X2=0:X3=0 FOR X1=1 TO 1000000 'RANDOMIZE TIMER N1 = INT((RND(1) * 3...
- Apr 29, 2023 22:51
- Forum: Beginners
- Topic: How to use RND and RANDOMIZE TIMER
- Replies: 4
- Views: 1456
How to use RND and RANDOMIZE TIMER
Hi! I'm having problems with RND and RANDOMIZE TIMER. What's wrong with my code? The numbers are not very random for 1 million spins on a European roulette wheel. DIM SHARED AS LONGINT X1,X2,X3,X4 DIM SHARED AS DOUBLE N1 FOR X4=1 TO 20 X2=0:X3=0 RANDOMIZE TIMER FOR X1=1 TO 1000000 N1 = INT((RND(21) ...
- Jun 11, 2022 2:28
- Forum: Beginners
- Topic: Running old QBasic code in FB
- Replies: 46
- Views: 4085
Re: Running old QBasic code in FB
Okay fxm, I'll remember using a different variable at the beginning and ending of a FOR/NEXT loop. Thank You.
- Jun 09, 2022 21:06
- Forum: Beginners
- Topic: Running old QBasic code in FB
- Replies: 46
- Views: 4085
Re: Running old QBasic code in FB
I have a new problem that got solved. The following does not work: ' ** STORE COMMANDS ** #lang "QB" 'Screen Color 2 ' Returns the number of times that a substring is found within a string. ' ---------------------------------------------------------------------- FUNCTION fnstrn (Search$, L...