Search found 1315 matches

by caseih
Aug 06, 2019 0:58
Forum: Hardware Interfaces / Communication
Topic: FreeBasic communication with Arduino logic error?
Replies: 50
Views: 2047

Re: FreeBasic communication with Arduino logic error?

It's not necessary to be root to access serial ports. Nearly all modern Linux distros have a group called, somewhat anachronistically, "dialout" and all serial devices are by default set to be group read and write-able to that group ip. So you just need to add your user id to that group an...
by caseih
Aug 03, 2019 19:06
Forum: Beginners
Topic: Can FB simple animations be run on a website?
Replies: 8
Views: 625

Re: Can FB simple animations be run on a website?

Are you wanting to make the animations be interactive? In other words are you trying to turn your FB programs into web-based programs that take user input from the web page and generate the appropriate animation? Or are you just wanting to capture the animations and re-play them back in a web page? ...
by caseih
Aug 03, 2019 3:18
Forum: Projects
Topic: FreeBASIC access to Rpi GPIO pins
Replies: 17
Views: 1744

Re: FreeBASIC access to Rpi GPIO pins

Using the code example below I get this error? blinkLedRpi.bas(18) error 42: Variable not declared, outout in 'open "/sys/class/gpio/gpio29/value" for outout as #hFile' Looking closely at that error message, the problem is that you spelled output wrong (outout). But that is a bit weird of...
by caseih
Jul 24, 2019 18:30
Forum: Beginners
Topic: Advantages of different GUI libraries
Replies: 18
Views: 754

Re: Advantages of different GUI libraries

Is there a link to sample code embedding Tcl/Tk in Freebasic program? Not that I know of. Also I don't know of any FreeBASIC translations of the Tcl C header files, so you'd have to translate them into .bi files yourself, or at least translate enough of them to access the C api. This is what I trie...
by caseih
Jul 24, 2019 16:55
Forum: Beginners
Topic: Advantages of different GUI libraries
Replies: 18
Views: 754

Re: Advantages of different GUI libraries

Can Tk be used from Freebasic? Yes it could, just as you can use Tk from C. But you'd need to translate the C header files into FB .bi files for the Tcl C API library. Basically you'd be embedding the Tcl interpreter inside your FB program, and then using the C API to interact with it, and to inter...
by caseih
Jul 23, 2019 21:54
Forum: Beginners
Topic: Advantages of different GUI libraries
Replies: 18
Views: 754

Re: Advantages of different GUI libraries

Since when is WIN-API cross platform (WIN & LIN)? Natively, without WINE, that is. Well technically wine let's you compile win32 C (and C++) source code to native linux binaries using what they call winelib. The result is an elf executable and a few shared libraries. In fact you can even use wi...
by caseih
Jul 15, 2019 14:57
Forum: Community Discussion
Topic: New array features
Replies: 127
Views: 6891

Re: New array features

FB is a language that implements variables as boxes in memory that you can address, so I would expect a deep copy in FB, and that appears to be what happens. Python is more abstract and its variables do not work the same way. Also I notice in python (lists) that it seems to be a pointer copy also. T...
by caseih
Jul 14, 2019 4:53
Forum: General
Topic: Squares
Replies: 6841
Views: 393467

Re: Squares

Zlib uses the "deflate" compression algorithm, which is actually a combination of a couple of different common compression algorithms. It's well documented if you wish to learn more about it.
by caseih
Jul 06, 2019 1:57
Forum: Libraries
Topic: python experiment
Replies: 33
Views: 1288

Re: python experiment

Correct. ctypes is, in Python 3 at least, a built-in module. Python 3 is definitely faster than Python 2. If you're trying to do a lot of intensive math calculations in Python, you will be disappointed compared to compiled FB performance. However in the scientific and math community Python is often ...
by caseih
Jul 05, 2019 14:55
Forum: Libraries
Topic: python experiment
Replies: 33
Views: 1288

Re: python experiment

The final alternative is to create a Python function using the C API and have that function pass data between FB and Python. See https://stackoverflow.com/questions/13942128/how-to-pass-an-array-from-c-to-an-embedded-python-script. The SOF article speaks only about passing data to Python. You might...
by caseih
Jul 04, 2019 17:15
Forum: Libraries
Topic: python experiment
Replies: 33
Views: 1288

Re: python experiment

@jj2007 I did a fair amount of web searching and pipes were among the hits, it's a pity that there's no simple and efficient way to exchange data. There are several methods. You can create a Python object from FB, such as a Python list, and then insert data into that list. You could also cast your ...
by caseih
Jul 04, 2019 4:53
Forum: Libraries
Topic: python experiment
Replies: 33
Views: 1288

Re: python experiment

srvaldez wrote:I really don't understand why PyRun_AnyFileExFlags(fp, name_, 0, NULL) needs a filename when it already has a file pointer
It might have something to do with setting the __name__ variable for the python script.
by caseih
Jul 03, 2019 16:40
Forum: Libraries
Topic: python experiment
Replies: 33
Views: 1288

Re: python experiment

I'm pretty sure the API uses C int regardless of 32 or 64-bit host. Py_Main is designed to be passed the same data structures that a C main program is passed, which is int and a t_wchar **. On Linux everything is UTF-8, so t_wchar is the equivalent of char. So the declaration is probably more along ...
by caseih
Jul 03, 2019 14:06
Forum: Libraries
Topic: python experiment
Replies: 33
Views: 1288

Re: python experiment

dodicat the one hairy detail is: how to exchange data between the python script and FB, sure you could write it to a file and then read it, but that's not very efficient. If we had the complete Python API declared for FB then you would just create a Python object around your FB data and you'd have ...
by caseih
Jul 03, 2019 14:03
Forum: Libraries
Topic: python experiment
Replies: 33
Views: 1288

Re: python experiment

[quote="dodicat"] PyMain cdecl alias "Py_Main"(as integer=0,as zstring ptr=0) as integer I can't speak to Win32, but I'm pretty sure on Linux and Mac, that a C int is always 32-bit, even on 64-bit systems. So this declaration should probably be Long instead of Integer. I think th...

Go to advanced search