Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Create a new character?
#7
Oh check this out, a tiny editor started!
Code: (Select All)
_Title "MyCurs Test use left and right arrow keys to move cursor" 'b+ 2023-01-24
Screen _NewImage(800, 600, 32)
cursCol = 1: cursRow = 1
text$ = "Hello World"
Do
    Cls
    Print text$
    myCurs cursRow, cursCol
    kh& = _KeyHit
    If kh& = 19200 And cursCol > 1 Then cursCol = cursCol - 1
    If kh& = 19712 And cursCol < 100 Then cursCol = cursCol + 1
    If (kh& >= 65 And kh& <= 90) Or (kh& >= 97 And kh& <= 122) Then
        text$ = Mid$(text$, 1, cursCol - 1) + Chr$(kh&) + Mid$(text$, cursCol)
    End If
    If kh& = 8 Then
        If cursCol > 1 Then
            text$ = Mid$(text$, 1, cursCol - 2) + Mid$(text$, cursCol)
            cursCol = cursCol - 1
        End If
    End If
    _Display
    _Limit 60
Loop

Sub myCurs (row, col) ' use row col like for Locate
    'Locate row, col
    Static As Long lc, toggle
    lc = lc + 1
    If lc > 1000000 Then lc = 0
    If lc Mod 20 = 0 Then toggle = 1 - toggle
    If toggle Then c~& = _RGB32(255, 255, 255) Else c~& = _RGB32(0, 0, 0)
    Line ((col - 1) * 8, (row - 1) * 16)-Step(0, 15), c~&
End Sub

Yeah should use ElseIf's...
b = b + ...
Reply


Messages In This Thread
Create a new character? - by PhilOfPerth - 01-25-2023, 01:24 AM
RE: Create a new character? - by bplus - 01-25-2023, 02:46 AM
RE: Create a new character? - by PhilOfPerth - 01-25-2023, 03:38 AM
RE: Create a new character? - by mnrvovrfc - 01-25-2023, 03:58 AM
RE: Create a new character? - by bplus - 01-25-2023, 04:05 AM
RE: Create a new character? - by bplus - 01-25-2023, 04:14 AM
RE: Create a new character? - by bplus - 01-25-2023, 04:31 AM
RE: Create a new character? - by bplus - 01-25-2023, 04:41 AM
RE: Create a new character? - by mnrvovrfc - 01-25-2023, 02:24 PM
RE: Create a new character? - by SMcNeill - 01-25-2023, 08:51 AM
RE: Create a new character? - by PhilOfPerth - 01-25-2023, 09:21 AM
RE: Create a new character? - by bplus - 01-25-2023, 06:50 PM
RE: Create a new character? - by bplus - 01-25-2023, 08:07 PM



Users browsing this thread: 3 Guest(s)