Search found 110 matches
- May 11, 2024 3:36
- Forum: Beginners
- Topic: Program Exits With Array Problem
- Replies: 6
- Views: 406
Re: Program Exits With Array Problem
Is that the solution? Magic fixes like this are a probable sign you are experiencing memory corruption (out-of-bounds array access) and moving the array to the heap just hides the issue. As @fxm says, always use -exx to find out what's happening. Okay. I'll always use -exx to find out what is happe...
- May 07, 2024 4:33
- Forum: Beginners
- Topic: Program Exits With Array Problem
- Replies: 6
- Views: 406
Re: Program Exits With Array Problem
Most likely an array out of bounds error, yes. If I'm willing to bet, this line: DIM SHARED AS LONGINT YAxis2(1 TO E3+LB1) Probably doesn't work as you'd expect (unless E3 and LB1 are constants) They are NOT constants so you could be right. I coded DIM SHARED AS LONGINT YAxis2(E3+LB1) instead of DI...
- May 07, 2024 4:29
- Forum: Beginners
- Topic: Program Exits With Array Problem
- Replies: 6
- Views: 406
Re: Program Exits With Array Problem
What is the operating system? Compile the program with the '-exx' option and check if a runtime error message appears on the console output. [edit] Unlike 'DIM SHARED AS LONGINT YAxis2(221)' , 'DIM SHARED AS LONGINT YAxis2(1 TO E3+LB1)' defines a dynamic array (instead of static) with its data loca...
- May 03, 2024 8:32
- Forum: Beginners
- Topic: GETKEY error
- Replies: 3
- Views: 222
Re: GETKEY error
@Triopstor Probably need to read up the FreeBasic manual on GETKEY? https://www.freebasic.net/wiki/FBWiki This works for me with Windows11 dim as integer keyCode DO keyCode = GETKEY print keyCode; LOOP UNTIL keyCode =13 OR keyCode =32 OR keyCode = 15359 Thank you for responding BasicCoder2. Yes I d...
- May 03, 2024 2:47
- Forum: Beginners
- Topic: GETKEY error
- Replies: 3
- Views: 222
GETKEY error
I have a GETKEY loop that works well but I want to add to it. The code so far is: DO X5=GETKEY LOOP UNTIL X5=13 OR X5=32 OR X5=27 This will loop until ESC/SPACE/ENTER key is pressed how do I modify this to include: TAB KEY GETKEY=9 F1 KEY GETKEY=15359 When I try for "LOOP UNITIL X5=13 OR X5=32 ...
- May 02, 2024 23:28
- Forum: Beginners
- Topic: Program Exits With Array Problem
- Replies: 6
- Views: 406
Program Exits With Array Problem
Hi! I have a program that Exits at this piece of code: SSpin1=1:S5=S5+SSpin1:Y1=SSpin1:S6=SSpin1:S7=S7+SSpin1:beep:print Y1,C1:sleep:FOR X2=1 TO Y1:YAxis2(X2)=C1:NEXT X2:beep:beep:beep I'm using Sleep and Beep as a way to trace the problem. When I run the code I get 1 beep then a print of "1 1&...
Re: fonts
Thank You dogicat for your code:
I think I'll use it if I can't find my old one from my personal library. I had a program that made different fonts by first printing the font in the bottom left hand corner. Then reading the pixel and doing double, quadruple sizes.
Triopstor.
I think I'll use it if I can't find my old one from my personal library. I had a program that made different fonts by first printing the font in the bottom left hand corner. Then reading the pixel and doing double, quadruple sizes.
Triopstor.
- Jun 28, 2023 15:45
- Forum: Beginners
- Topic: Recover Losses Problem
- Replies: 12
- Views: 2087
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: 2087
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: 337
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: 2087
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: 2087
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: 2087
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: 2087
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: 2087
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...