Search found 1645 matches

by srvaldez
Nov 14, 2018 22:47
Forum: General
Topic: gosub's in functions and subs
Replies: 15
Views: 115

Re: gosub's in functions and subs

yes, I suppose so. it works OK on MacOS FBx64 and Win-FBx86 but not on Win-FBx64 FreeBASIC Compiler - Version 1.06.0 (05-07-2017), built for win64 (64bit) Copyright (C) 2004-2016 The FreeBASIC development team. standalone target: win64, x86-64, 64bit proc: 0! proc: 1! proc: 2! proc: 3! -------------...
by srvaldez
Nov 14, 2018 21:32
Forum: General
Topic: gosub's in functions and subs
Replies: 15
Views: 115

Re: gosub's in functions and subs

If you forget a 'return', also completely different behaviour. This was one of the issues with the GW-QBASIC code I converted. Returns were on purpose or accidentally missing. With a normal sub or function the compiler catches it. you have a point about error reporting on missing or extra retun's, ...
by srvaldez
Nov 14, 2018 21:25
Forum: General
Topic: gosub's in functions and subs
Replies: 15
Views: 115

Re: gosub's in functions and subs

tested OK on the RPI

Code: Select all

pi@raspberrypi:~ $ fbc -version
FreeBASIC Compiler - Version 1.06.0 (09-01-2017), built for linux-arm (32bit)
Copyright (C) 2004-2016 The FreeBASIC development team.
by srvaldez
Nov 14, 2018 21:22
Forum: General
Topic: gosub's in functions and subs
Replies: 15
Views: 115

Re: gosub's in functions and subs

I commented out 'end' in victor codes: Result: Aborting due to runtime error 12 ("segmentation violation" signal) in trick.bas::() If you forget a 'return', also completely different behaviour. This was one of the issues with the GW-QBASIC code I converted. Returns were on purpose or acci...
by srvaldez
Nov 14, 2018 20:50
Forum: General
Topic: gosub's in functions and subs
Replies: 15
Views: 115

Re: gosub's in functions and subs

@badidea
let's not turn this thread into a debate, properly used goto and gosub can be used to write clear an understandable code.
by srvaldez
Nov 14, 2018 20:47
Forum: General
Topic: gosub's in functions and subs
Replies: 15
Views: 115

Re: gosub's in functions and subs

@dodicat
using asm is not a clean solution in my opinion, whereas the solution posted by v1ctor works across platforms, have not tested outside MacOS, but if it works there, it should work on other platforms as well, need to test to see if it works on the RPI.
by srvaldez
Nov 14, 2018 20:19
Forum: General
Topic: gosub's in functions and subs
Replies: 15
Views: 115

Re: gosub's in functions and subs

badidea wrote:Because it is dirty stuff?

I don't understand the purpose of your question, I made that note about using gosub to jump into another sub or function because for one, it's not supported and because it's just plain dirty, but using gosub within a sub or a function could be useful.
by srvaldez
Nov 14, 2018 19:26
Forum: General
Topic: gosub's in functions and subs
Replies: 15
Views: 115

gosub's in functions and subs

on Aug 03, 2006 v1ctor posted this neat solution https://www.freebasic.net/forum/viewtopic.php?p=44311#p44311 why not include the include file and the example in the FB distribution? note, the example given uses subs as example, but it works equally well in functions. tested on MacOS FB-1.06 [note] ...
by srvaldez
Nov 14, 2018 19:16
Forum: General
Topic: porting plot library to FB?
Replies: 0
Views: 25

porting plot library to FB?

I found this nice but rather dated library http://koolplot.codecutter.org the license is in the public domain, would anyone that's capable be willing to port this lib to FB? I like the simplicity #include "koolplot.h" int main() { Plotdata x(-3.0, 3.0), y = sin(x) - 0.5*x; plot(x, y); retu...
by srvaldez
Nov 14, 2018 17:01
Forum: Community Discussion
Topic: [offtopic] FreePascal
Replies: 73
Views: 2241

Re: [offtopic] FreePascal

here's a nice introduction to Object Pascal http://newpascal.org/assets/modern_pasc ... ction.html
by srvaldez
Nov 14, 2018 14:46
Forum: Libraries
Topic: FLTK C for FreeBASIC Jan 09, 2017
Replies: 169
Views: 21775

Re: FLTK C for FreeBASIC Jan 09, 2017

hello D.J.Peters :-)
I am looking forward to your gift :-)
by srvaldez
Nov 02, 2018 15:57
Forum: General
Topic: Print string as x pattern
Replies: 2
Views: 109

Re: Print string as x pattern

is this what you are after? 'Print string of odd length in ‘X’ format 'https://www.geeksforgeeks.org/print-string-of-odd-length-in-x-format/ 'transllated to FB by srvaldez Sub printPattern(Byval s As String, Byval length As Long) ' i and j are the indexes of characters ' to be displayed in the ith i...
by srvaldez
Nov 02, 2018 8:24
Forum: General
Topic: timing benchmark using reduced precision
Replies: 4
Views: 125

Re: timing benchmark using reduced precision

@jj2007
yes, copy-paste mistake - corrected, thanks for pointing it out.
[note] only division and sqr benefit from reduced precision, my hypothesis is that's because iteration is used.
by srvaldez
Nov 01, 2018 22:25
Forum: Windows
Topic: gcc 5.2 vs gcc 8.1
Replies: 64
Views: 2285

Re: gcc 5.2 vs gcc 8.1

spoke too soon, it fails to compile the program listed here https://www.freebasic.net/forum/viewtopic.php?f=3&t=27125 St_W, please continue your nightly builds as they currently are, that is not merged and with gcc-4.8.2 because that package works without problems. thank you for providing the ni...

Go to advanced search