Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Please help with compiler trouble  (Read 306 times)

huggy70

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 3
  • Generic Amiga User
Please help with compiler trouble
« on: March 07, 2020, 09:18:56 AM »

Hi everybody, I recently startet looking into a 25 year old project I did with amos pro back then. Its basically a midi pattern editor that runs quite well on winuae. My plan is to run this on a raspi with touch screen to edit and play drum patterns and send them to a drum machine (everyone who used the built in pattern editor of a drum machine knows how they could drive you insane)

So I fixed some bugs and wanted to do a little more stuff but found the editor of amos a little annoying tu handle these days. So I dumped the project to ascii and started to implement a language definition file and function list plugin for notepad++ which I was quite satisfied with (if anyone is interested i'll be happy to share).

To make things short:
I want to compile the ascii code, so first I tokenized the code without any error. I can load the tokenized program into amos pro and run it without error.
I can even compile the program from the amos pro menu without any error and it runs fine.

Now here's the problem:
I want to compile the program from command line but the compiler gives me:
Syntax error at line 2830:           a$=>>> left$(a$,xc-xpos-1)+mid$(a$,xc

I cannot see any syntax error in that line and as told before even amos pro editor does not.
Does anyone know what is causing this or a workaround? Or is there a list of compiler bugs and workarounds?  ::)

Thanks for your help!
Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 306
  • Offline Offline
  • Posts: 3,329
  • Don't forget... Ameboid's need love too!
    • Amiga Online
Re: Please help with compiler trouble
« Reply #1 on: March 21, 2020, 09:52:00 PM »

it looks like part of the code is cut off?  there is no closing bracket, and doesnt "mid$" take 3 arguments?
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace's Artwork Available
Buy my work

http://twitter.com/horaceandspider

huggy70

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 3
  • Generic Amiga User
Re: Please help with compiler trouble
« Reply #2 on: March 22, 2020, 09:19:12 AM »

Thanks fpr your reply!

it looks like part of the code is cut off?  there is no closing bracket, and doesnt "mid$" take 3 arguments?

No, it isn't. The actual line is:
    A$=Left$(A$,XC-XPOS-1)+Mid$(A$,XC-XPOS+1)

mid$ accepts 2 parameters and 3 parameters with direct assignment to a variable.
This must be some bug in the compiler as the exact tokenized file can be loaded into the editor and runs without error  ???

Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 306
  • Offline Offline
  • Posts: 3,329
  • Don't forget... Ameboid's need love too!
    • Amiga Online
Re: Please help with compiler trouble
« Reply #3 on: March 22, 2020, 09:57:42 AM »

Thanks fpr your reply!

No, it isn't. The actual line is:
    A$=Left$(A$,XC-XPOS-1)+Mid$(A$,XC-XPOS+1)

mid$ accepts 2 parameters and 3 parameters with direct assignment to a variable.
This must be some bug in the compiler as the exact tokenized file can be loaded into the editor and runs without error  ???

The manual shows MID$ accepting 3 parameters as it's default example, so maybe there is some differences from later changes.

Quote
MID$ function: return a number of characters from the middle of a string

destination$=Mid$(source$,offset,number)
Mid$(destination$,offset,number)=source$

Similarly, the MID$ function returns characters from the middle of a string, with the first number specified inbrackets setting the offset from the start of the string and the second number setting how many characters are to befetched.

If the number of characters to be fetched is omitted from your instruction, then the characters will be readright up to the end of the string being examined.


This to me, suggests that the '2 only' option was added late in development, and maybe this is why the Compiler doesn't accept it.

So have you tried using it with 3 as a test? Obviously you'll have to determine how many characters you want, but it shouldnt be that difficult using LEN etc, and you can always specify '1' just to test it in the compiler.
« Last Edit: March 22, 2020, 10:00:02 AM by Hungry Horace »
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace's Artwork Available
Buy my work

http://twitter.com/horaceandspider

huggy70

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 3
  • Generic Amiga User
Re: Please help with compiler trouble
« Reply #4 on: March 22, 2020, 06:04:02 PM »


The manual shows MID$ accepting 3 parameters as it's default example, so maybe there is some differences from later changes.

Quote
MID$ function: return a number of characters from the middle of a string

destination$=Mid$(source$,offset,number)
Mid$(destination$,offset,number)=source$

hmh, the manual also shows examples with 2 Parameters in Chapter 05.02.02
Shure I can try to workaround this  by code( I don't even know what this part of code is doing, the code is from 1994  ;D )
As stated in my initial post the error only appears when compiling from command line. Compiling from menu within the editor works fine  :)

But I want to implement some kind of tool chain so I need the command line compiler  :-[

thanx!
Logged
Pages: [1]   Go Up
 

TinyPortal 1.6.4 © 2005-2019