Page 1 of 1

Ceiling() function with Macro

Posted: Mon Mar 29, 2010 3:05 pm
by sudip
Hello All,

I found some problem with using CEILING() function with Macro. Interestingly I found it works, only if I call CEILING() function directly as a dummy function!!! ;)
Ceiling_Macro.jpg
Ceiling_Macro.jpg (18.53 KiB) Viewed 2415 times

Code: Select all

#include <hmg.ch>

Function Main

   DEFINE WINDOW main at 0, 0 width 450 height 300  TITLE "Macro Test with CEILING() function!!!" MAIN
   
      DEFINE TEXTBOX Text_1
         ROW    50
         COL    80
         INPUTMASK "9999.999"
         FORMAT Nil
         NUMERIC .T. 
      END TEXTBOX
   
      DEFINE BUTTON Button_1
         ROW    50
         COL    300
         ACTION test1()
         CAPTION "Gives Error!!!"
      END BUTTON
   
   END WINDOW

   Main.Text_1.value := 100.001   
   Main.Center
   Main.Activate

Return                


function Test1()
   local x := "CEILING("+str(main.text_1.value)+")"
   // dummy 
   //CEILING(1) // but runs fine when you clear the comments of this line before ceiling()!!!   
   msgbox(str(&x))
   return nil
I have very little knowlege on macro. So, can you please help me to understand the behavior :)

Thanks in advance. :)

With best regards.

Sudip

Re: Ceiling() function with Macro

Posted: Mon Mar 29, 2010 6:08 pm
by esgici
Hi Sudip

REQUEST CEILING

Regards

--

Esgici

Re: Ceiling() function with Macro

Posted: Mon Mar 29, 2010 8:57 pm
by Czarny_Pijar
sudip
Try other functions ( SIN, TAN ) - the result is the same.
I guess this is not macro related behaviour, this is the dynamic linking factor, where only the functions spotted in the code are included in the exe file. As esgici suggested, you have to explicity inform the linker, which functons haven't to be omitted.

Re: Ceiling() function with Macro

Posted: Tue Mar 30, 2010 4:24 am
by sudip
Thanks lot Esgici, Czarny Pijar :)
It works :)