June 18, 2024, 10:30:06 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Craft Basic Interpreter

Started by basicgames, November 20, 2022, 01:25:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

basicgames

November 20, 2022, 01:25:33 AM Last Edit: March 04, 2023, 04:00:49 PM by basicgames
Craft Basic is a BASIC interpreter for Windows 95 and up.

Homepage:
http://www.lucidapogee.com?page=craftbasic

Documentation:
http://www.lucidapogee.com/craftbasic/craftbasichelp.html


Tested on 95, XP, and 10.

* learn programming
* make simple games
* write code interactively
* perform complex calculations
* display cool graphics
* build windows with forms
* write useful scripts
* and more...

Brian

I took the plunge after my Malwarebytes reported the download as suspicious. Turned out it was okay after doing a manual scan of the files
The code is Emergence Basic based, and the supplied exe doesn't need EB to run. I need more time to run through the supplied examples, but what I have seen seem to work fine
Would take a fair bit of work to convert to IWB, I reckon, if you were so inclined

Brian

basicgames

Thank you for looking into this.

I wonder what part of my code triggers the suspicion. The fact that so many features are packed into such a small exe alone may be enough.

Emergence basic has been my most favored language and IDE since I downloaded it in 2007. I was 13 at the time and could only do simple programs. After many years, I returned to it intending to learn and master it's more complex features.

After starting with a series of games and utilities, I have made Craft Basic. Although, Craft Basic started in Qbasic. The Qbasic version is called Tiny Craft basic and is line number oriented. Both interpreters feature the same expression evaluation method and precedence.

I am planning to purchase IWB soon so that I may gain access to all the updates and information. It will be a worthwhile investment for me to learn how to use it and I already have plans to rewrite a better version of Craft Basic.

Not to mention, I am interested in the possibility of using IWB to make a Linux version of Craft Basic.

Brian

Well, after downloading your new version, it reports that the actual exe has Malware, something about zero-day, which I don't pretend to understand. Maybe it is to do with not signing your exe, ie, not having a manifest file, or VERSIONINFO embedded - don't know. I have seen problems reported without them

I can send you a manifest file and VERSIONINFO text if you require them, but your exe would then require to be compiled as a Project

More info on zero-day: https://www.malwarebytes.com/blog/news/2017/04/what-is-a-zero-day

I have just run 3drotate.bas without the hDC lines - no problem

Brian

basicgames

Zero day. That sounds wild.

I got your email and read the article. Thank you. I downloaded the files and am trying to see how to set it all up.

How did you make the manifest and rc files?

basicgames

February 20, 2023, 12:31:29 PM #5 Last Edit: February 20, 2023, 12:48:56 PM by basicgames
I have never been able to compile a project with Ebasic. Only source. Not sure why.
I do see now how to create/add the versioninfo in the project resources.

My ide is version 1.62 and compiler is 1.63.

Compiling Resources...
No Errors

Compiling...
Craft Basic.eba

Linking...
Emergence Linker v1.11 Copyright © 2006 Ionic Wind Software
Unresolved external _ib_main
Error: Unresolved extern _ib_main
Error(s) in linking Craft_Basic.exe

I also tried what was suggested in this thread with the manifest file https://www.ionicwind.com/forums/index.php?topic=4290.msg33363#msg33363

Still getting the error.

LarryMc

Did you follow this instruction from the help file on creating projects?

Every Windows or Console Executable project must contain a $MAIN directive to indicate where execution should begin.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

basicgames

That seems to be the problem. I didn't have $main.

It still doesn't seem quite perfect, so I need more time to mess around with it.

I am also working on preparing the necessary bits for doing a rewrite and am looking into rich text. I might try a whole different approach on version 2, but with the same syntax language.

basicgames

February 22, 2023, 03:46:31 AM #8 Last Edit: March 04, 2023, 03:57:44 PM by basicgames
I updated Craft Basic to include versioninfo and manifest. It's available in the download.
There's a strange issue that my icon shows on the explorer, but not the program window itself.
I used
SETICON win,LOADIMAGE(1,@IMGICON)and it somewhat worked.
Except now it's showing in different colors.
Is there something I am doing wrong?

Brian

Try the attached icon - works for me. Rename the cb.txt to cb.ico

Anyway, still shows a Malware error on the site, but I took the plunge and downloaded your setup. Compiled ok, but there is still something in there that Malwarebytes doesn't like, so it Quarantines it straight away, and I can't run it

Brian

LarryMc

February 22, 2023, 06:34:32 PM #10 Last Edit: February 22, 2023, 06:45:29 PM by LarryMc
I had some time on my hands this afternoon while waiting on some some woodworking parts to show up so I downloaded CraftBasic from your website.
I created a project in IWBasic and loaded your source file and spent a good deal of time getting rid of all the error messages by modifying the code so it would run in IWB.
The problem that gave me the biggest problem was the
command=GetCommandLineA()
[/b][/i] at line 377
int the lib file you are using it returns a string and in the lib IWB uses it returns a pointer.
It has been a few years since I've messed with pointers but I think i've got that fix with this code
def p as pointer
p =GetCommandLineA()
command =#<string>p
[/b][/i]
The last hump I was left with was the malware issue. My method of attack was to eliminate sections of code to see if I could find it that way.  The first thing I tried was the help routine. I put a return at the entry into the routine and commented out the rest of the routine.  The program compiled and ran without any malware reportfor a couple of compiles and then the malware reports came back. 
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

It wasn't the helpfile code after all.  I have no idea why it compiled that few times without a malware flag. I've eliminated over 2/3 of the code                                                                                                                                                 and everything related to the dialogs and still get the malware flag.
still looking
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

basicgames

Over 2/3 and still no luck? Amazing.

While reading this thread, I realized that I am not the only one who has had this problem http://www.ionicwind.com/forums/index.php?topic=5836.0

LarryMc

Attached is a copy of the source file only for Craft Basic with all the corrections made to eliminate all the compile time error messages except the ones for unused variables.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

basicgames

Thank you very much for helping with this code. I'm going to download it and take time to see the differences. Did you still get a malware warning?

LarryMc

no malware warning with AVG when I compiled it
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library