Code: Select all
' Coded by : Andrew Gable
' Designed by : Andrew Gable
' Software owned by : Andrew Gable and algPoS, Northampton
' This is a Example of how to use the Page copying mode to smooth out the graphics and Hopefully make the application
' More stable
'Screen copy example
#Include "string.bi"
#Include "vbcompat.bi"
Declare Sub DrawPoSScreen
Declare Sub CopyPage
ScreenRes 800, 600, 32, 2 'Set the Screen to 800x600 with 32 depth and 2 Video pages
ScreenSet 1, 0 ' Set the hiden page as the default to be drawn to
'Main Loop
Do
DrawPoSScreen ' Draws the PoS Screen on to the Invisible Page
CopyPage 'Moves the hiden page to the Screen
Loop Until Len(Inkey$)
Private Sub DrawPoSScreen
Dim DisplayChrs As Integer = 98
Cls
Locate 1,1 : Print Chr(201) & String(DisplayChrs,Chr(205)) & Chr(187);
Locate 2,1 : Print Chr(186) & String(DisplayChrs," ") & Chr(186);
Locate 3,1 : Print Chr(186) & String(DisplayChrs," ") & Chr(186);
Locate 4,1 : Print Chr(186) & String(DisplayChrs," ") & Chr(186);
Locate 5,1 : Print Chr(200) & String(DisplayChrs,Chr(205)) & Chr(188);
Locate 2,10 : Print " " & "Hello This is the PoS Screen";
Locate 3,10 : Print " " & "Current Time : " & Format(Now, "hh:mm:ss");
Locate 4,10 : Print " " & "Current Date : " & Format(Now,"dd/mm/yyyy");
End Sub
Private Sub CopyPage
PCopy 1, 0 ' Move the hiden page to the visible page (shows it on the Display)
ScreenSet 1, 0
End Sub
As you can see I have taken myself BACK to the basics to figure something out
What I want to do is have a function that can run independently of the main loop but still update the screen
how would i add to my example code "FreeBASIC is Cool" and have it bounce around the screen independently to my time loop? (a bit like a screen saver)
The end goal is to have the Time and date independent to anything the Program is doing (In the perfect world i would like the example app to run on DOS as well as Linux but I am happy for any help anyone can give (even if it just to run on Linux)