Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - eekee

Pages: [1]
1
QB64 Discussion / Re: Bizzarre error with $include
« on: November 26, 2021, 07:08:42 am »
put the include on line 15
I tried this first, but got an even weirder error. :) When I entered `TPen down` in turtle-test.bas, (a normal use of TPen,) it told me "name already in use".

Indeed, the main body of the code may not appear after any subroutines. The standard pattern is to include "turtle.bi" at the top of the program with needed declarations, and "turtle.bm" at the bottom with Sub and Function implementations.
This worked, thanks! :)
Welcome @eekee I look forward to fixing your Turtles code as stated and checking it out.

Oh not finished, don't forget to change Turtle Angle degrees into radians in Sin() and Cos() for Move use _D2R() degrees to radians.
Good catch, thanks!

2
QB64 Discussion / Re: Trouble understanding MID$( )
« on: November 07, 2021, 02:39:58 am »
This looks very much like the sort of errors I used to make for years. I felt like I was getting on all right, but I commonly mis-remembered syntax or started doing something differently and didn't notice. I often couldn't see anything wrong even when it was something very simple. Despite this, I could still type mostly coherent English and my programming errors tended to only show in one specific thing. Typically for me, it was regular expressions.

As such, I respectfully suggest the OP get more fresh air. Carbon dioxide -- the stuff we breathe out -- builds up fast and has a surprisingly stong affect on brain function. I forget the exact figures, but it's easy to build up enough carbon dioxide to halve brain function. Bedrooms have been known to build up even more than that. Ventilation is essential. Sadly, it's sometimes impossible to get enough ventilation; some entire valleys develop unacceptably high carbon dioxide levels on still days. It must also be noted that microbes which consume organic detritus (dirt) also produce carbon dioxide.

As to why this is showing up with MID$ specifically, I recall it being the hardest function to understand when I was little. I don't know why, it just was. I hated it for a while.

3
QB64 Discussion / Bizzarre error with $include
« on: November 07, 2021, 01:53:37 am »
Hullo! I just used $include for the first time, and I got a bizzarre error. The screenshot shows the actual error along with the version. The compiler (or the IDE, at least,) appears to think there's some unbalanced use of SUB or FUNCTION, but there isn't. The included file, turtle.bas, compiles and runs, (it just doesn't do anything beyond initializing variables,) so I haven't forgotten END SUB or anything.

Oh... I think I see. Is it because turtle.bas contains SUB and FUNCTION definitions; can statements not be placed after such things? It looks like I need to make one of two changes to turtle.bas: split it up into separate initialization and routine files or put all its initialization into a subroutine. Is that right? (I'd like it to be wrong.)

Pages: [1]