• Welcome to Jose's Read Only Forum 2023.
 

FreeBASIC And/Or Inline Assembly

Started by Donald Darden, June 15, 2007, 12:03:44 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Eros Olmi

Yes, I do the same.
Plus I have another one taken from PB forum (do not remember who to thanks, sorry):

  '%DBG_ShowVar = 1
  '------------------------------------------------------------------------------
  MACRO ShowVar (VarLabel, VarValueNum, VarValueStr, strMsgBox)
  '------------------------------------------------------------------------------
    #IF %DEF(%DBG_ShowVar)
      ShowVarFun (VarLabel, VarValueNum, VarValueStr, strMsgBox)
    #endif
  END MACRO

#IF %DEF(%DBG_ShowVar)
  '------------------------------------------------------------------------------
  FUNCTION ShowVarFun (BYVAL VarLabel AS STRING, BYVAL VarValueNum AS EXT, BYVAL VarValueStr AS STRING, BYVAL strMsgBox AS STRING) AS LONG
  '------------------------------------------------------------------------------
    GLOBAL hVDsp          AS LONG
    STATIC ControlCount&
    LOCAL i&,CntrlText$,NewLbl$,MatchLbl&,yy&
    LOCAL ValToShow AS STRING
    STATIC TotalCount AS QUAD
    LOCAL lResult AS LONG

    '---NewDoEvents
    INCR TotalCount
    MatchLbl& = 0
    yy& = ControlCount& * 10 + 30
    IF  ControlCount& = 0 THEN
      DIALOG  NEW   0,  "Event display", 500, 50, 500, yy& + 10, %ws_border , TO hVDsp
      CONTROL ADD   FRAME , hVDsp, 1000, "Event info", 2, 1, 490, yy&, %ss_sunken,
      DIALOG  SHOW  MODELESS hVDsp
    ELSE
      DIALOG SET TEXT hVDsp, "Event display:" & STR$(TotalCount)
    END IF
    NewLbl$ = VarLabel + "   :"
    FOR i& = 1 TO ControlCount& + 1
      CONTROL GET TEXT hVDsp,(1100 + i&) TO CntrlText$
      IF CntrlText$ = NewLbl$ THEN
        IF VarValueStr = "" THEN
          ValToShow = STR$(VarValueNum)
        ELSE
          ValToShow = VarValueStr
        END IF
        ValToShow = ValToShow & " (Event #:" & STR$(TotalCount) & ")"
        CONTROL SET TEXT hVDsp, (1200 + i&), ValToShow

        MatchLbl& = 1
        EXIT FOR
      END IF
    NEXT i&

    IF MatchLbl& = 0   THEN
      DIALOG  SET SIZE    hVDsp,      500,  yy& + 25
      CONTROL SET SIZE    hVDsp,     1000,  490, yy&
      CONTROL ADD LABEL , hVDsp,(1100+i&),  NewLbl$,4,i&*10-10,100,10,%SS_RIGHT,

      IF VarValueStr = "" THEN
        ValToShow = STR$(VarValueNum)
      ELSE
        ValToShow = VarValueStr
      END IF
      ValToShow = ValToShow & " (Event #:" & STR$(TotalCount) & ")"
      CONTROL ADD LABEL , hVDsp,(1200+i&),  ValToShow,110,i&*10-10,300,10,,
      INCR ControlCount&
    END IF
    SendMessage hVDsp,%wm_paint,0,0
   
    IF strMsgBox <> "" THEN
      lResult = MSGBOX(strMsgBox & $CRLF & STRING$(80, "_") & $CRLF & _
                        "Do you want to STOP execution?", %MB_YESNO OR %MB_DEFBUTTON2 OR %MB_TASKMODAL, "Critical Warning")
      IF lResult = %IDYES THEN
        '---RunTimeError(0, "Execution aborted by user")
      END IF
     
    END IF
  END FUNCTION
#endif



But can you call this: debugging?
;)
thinBasic Script Interpreter - www.thinbasic.com | www.thinbasic.com/community
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

Theo Gottwald

#16
Ok, then we are back to where I was with Purebasic some time ago.
Its good and cheap for unimportant tasks.
But when I need somethign of highest reliability I will ned to go back to ... PB.

How did Jose say it last time .."Its not that easy to built a reliable compiler" (or in that sense) :-).

Hoping that Bob will keep his head (see comment from Jose before) even when the next version of PB comes, which I expect to be more complicated internally then all versions before.