Announcement

Collapse
No announcement yet.

Thread implementation in 4DGL

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Thread implementation in 4DGL

    haii...anybody knows any thread concept implementation in 4DGL...
    RHS

  • #2


    What are you trying to achieve?

    You would tend to code a non blocking main loop checking the touch panel.

    If you were using serial comms, you could also add a non blocking check/read for the comms buffer within the main loop.

    So most other things could go in the same place, maybe
    Mark

    Comment


    • #3


      Thanks for ur reply...I am designing a GUI application and in that, first i want to display a splash screen at the same time in the back side a comport polling has to occur. So when the COM get a value, then it has to switch to another screen from the currently running splash screen. For that, i want to process has to run in parallel...splash screen and comport reading...thanks..
      RHS

      Comment


      • #4


        What I described should work well for you.
        Mark

        Comment


        • #5


          Could plz give a sample code for a non blocking main loop...
          RHS

          Comment


          • #6


            repeat
            // check comms for command, how to NAK invalid command
            if (com_Count() != 0)
            cmd[cmdi++] := serin() ;

            if (cmdi == 3) // assumes all serial commands are 2 bytes long
            // process command in 'cmd'
            cmdi := 0 ;
            endif
            endif

            // touch code processing, more detail in many Visi samples
            state := touch_Get(TOUCH_STATUS); // get touchscreen status
            n := img_Touched(hndl,-1) ;

            if ((state == TOUCH_PRESSED) || (state == TOUCH_RELEASED) || (state == TOUCH_MOVING))
            // do whatever is required
            endif

            forever
            Mark

            Comment


            • #7


              Yes...its working good..thanks a lot....
              RHS

              Comment

              Working...
              X