Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 17:28 24 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Calling other code with MMBasic

Author Message
Keith @

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 167
Posted: 12:48am 19 Nov 2011
Copy link to clipboard 
Print this post


To the software Gurus ....

Is it possible (by modifying MMBasic) to do calls of other software code from within MMBasic? (I know it can be done with VB calls of C++ DLLs)

For example ... if there is a C program (Arduino) to run a particular piece of hardware but this hardware hasn't been coded for in MMBasic would it be possible to run the code by calling it from within MMBasic (suitably modified to account for the idiosyncrasies of the Maximite/Duoinmite and the shield or component being used).


Keith


The more we know, the more we know we don't know !
 
crackerjack

Senior Member

Joined: 11/07/2011
Location: Australia
Posts: 164
Posted: 01:30am 19 Nov 2011
Copy link to clipboard 
Print this post

Tricky indeed. Does this piece of code expose some calling convention? What is the interface? Could the other code be accessed via some serial interface a la I2C or SPI?
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3800
Posted: 08:47am 19 Nov 2011
Copy link to clipboard 
Print this post

Yes it can be done.

I don't think it's there yet.

I guess someone could add it and I think the important thing would be working out the syntax etc.

Something like CCALL <var>(<args>) where <var> is a string with the code inside it and <args> are the data to pass across.

hmm, it should be able to return a value. x = CFUNC(<var>, <args>) maybe?

Other Basics have it.... go find one whose syntax you like :)

Then add it into MMBasic. Get Geoff's view on this!!

It would be useful to be able to load the <var> from a file.

JohnEdited by JohnS 2011-11-20
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 02:32pm 21 Nov 2011
Copy link to clipboard 
Print this post


Along similar lines, we have wish list 36 sitting there.

Wish 36: Help system via SD card. Either HELP "command" or HELP "command"/?

What a delight it would be to have a help system file on the SD card, and be able to access the text with some simple commands.

I'm sure users would easily put together the required text system. It is linking into MM-basic that requires the real work.

I feel it must be time to point members at the polls again:

http://www.themaximitecomputer.com/wish-list-priority-level- poll/

Cheers Don...
https://www.dontronics.com
 
trippyben

Regular Member

Joined: 26/06/2011
Location: Australia
Posts: 91
Posted: 10:45am 22 Nov 2011
Copy link to clipboard 
Print this post

  Keith @ said  
To the software Gurus ....

Is it possible (by modifying MMBasic) to do calls of other software code from within MMBasic? (I know it can be done with VB calls of C++ DLLs)

For example ... if there is a C program (Arduino) to run a particular piece of hardware but this hardware hasn't been coded for in MMBasic would it be possible to run the code by calling it from within MMBasic (suitably modified to account for the idiosyncrasies of the Maximite/Duoinmite and the shield or component being used).


Keith



I Guess you could include the required piece of code in the maximite source code, give it a name and format to match MMbasic, recompile it yourself and it could be called just by using the name given to it just as if it was originally included in mmbasic. (Much like some early user mods for I2C etc.)
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024