Menu

math power function

Help
2017-02-20
2017-02-20
  • stan cartwright

    stan cartwright - 2017-02-20

    I tried to use the power command
    plot2screenram:
    pixel = py%8 ; pixel position
    pixel=power(1,pixel)
    ptr=((py/8)*128)+px ;screen byte
    buffer (ptr)=buffer (ptr) or pixel ;plot pixel in buffer
    and get this error.
    gcb_plot-not-working.gcb (150): Error: Invalid variable name: POWER1,PIXEL
    gcb_plot-not-working.gcb (150): Error: Variable POWER1,PIXEL was not explicitly declared
    gcb_plot-not-working.gcb (187): Error: Array/Function PIXEL=POWER has not been declared
    gcb_plot-not-working.gcb (187): Error: Invalid variable name: POWER(1,PIXEL)
    gcb_plot-not-working.gcb (187): Error: Variable POWER(1,PIXEL) was not explicitly declared
    gcb_plot-not-working.gcb (191): Error: Variable ROW was not explicitly declared
    gcb_plot-not-working.gcb (202): Error: Array/Function PIXEL=POWER has not been declared
    gcb_plot-not-working.gcb (202): Error: Invalid variable name: POWER(1,PIXEL)
    gcb_plot-not-working.gcb (217): Error: Array/Function PIXEL=POWER has not been declared
    gcb_plot-not-working.gcb (217): Error: Invalid variable name: POWER(1,PIXEL)
    gcb_plot-not-working.gcb (231): Error: Cannot store -1 in the byte variable SY
    gcb_plot-not-working.gcb (245): Error: Array/Function PIXEL=POWER has not been declared
    gcb_plot-not-working.gcb (245): Error: Invalid variable name: POWER(1,PIXEL)
    gcb_plot-not-working.gcb (268): Error: Array/Function PIXEL=POWER has not been declared
    gcb_plot-not-working.gcb (268): Error: Invalid variable name: POWER(1,PIXEL)
    gcb_plot-not-working.gcb (298): Error: Cannot store -1 in the byte variable SY
    gcb_plot-not-working.gcb (310): Error: Array/Function PIXEL=POWER has not been declared
    gcb_plot-not-working.gcb (310): Error: Invalid variable name: POWER(1,PIXEL)
    gcb_plot-not-working.gcb (332): Error: Array/Function PIXEL=POWER has not been declared
    gcb_plot-not-working.gcb (332): Error: Invalid variable name: POWER(1,PIXEL)

     
  • Anobium

    Anobium - 2017-02-20

    I am guessing you are using a stock installation of Great Cow BASIC, version 0.96.0.

    No idea what is causing this error.

    Please post your user code, or, a section that should compile to reproduce the error.

    Best to do this whenever you post. Use add attachment for user code.

    Have you looked at the demo's? Is there a power example?
    I just tried the Help file example and that compiles ok.

     
  • William Roth

    William Roth - 2017-02-22

    The errors are symptomatic of not including maths.h in the source code

    Make sure the following line is in the GCB source code

    #include <Maths.h>
    

    Without seeing the GCB source code, not much more help can be provided.

     

    Last edit: William Roth 2017-02-22
  • stan cartwright

    stan cartwright - 2017-02-23

    Thanks. just power and logs,I didn't notice works with <maths.h></maths.h>

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.