Today 19:41
Forum: The Lounge
Starter: towlerg
Views: 0
Replies: 2
+ Reply to Thread
Results 1 to 6 of 6

Thread: Problem with Swap command86 days old

  1. #1
    Junior Member pjdenyer's Avatar
    Join Date
    Jun 2014
    Posts
    8
    Thumbs Up
    Received: 2
    Given: 0
    Total Downloaded
    503.51 MB

    1 Not allowed!

    Default Problem with Swap command

    I have a problem using the SWAP command in a procedure.

    -----------------------------------------------------------------------------------
    Proc Glcd_Rectangle_Filled(x0 As Word, y0 As Word, x1 As Word, y1 As Word, Glcd_wPenColour As Word)

    Dim
    Glcd_wSwap As Word
    Dim
    wWidth As Word
    Dim wHieght As Word

    If
    Glcd_bOrientation = 0 Or Glcd_bOrientation = 2 Then
    Glcd_wSwap = x0 : x0 = y0 : y0 = Glcd_wSwap ' My Swap
    Glcd_wSwap = x1 : x1 = y1 : y1 = Glcd_wSwap ' My Swap
    EndIf
    ------------------------------------------------------------------------------

    If I change My Swap to

    -----------------------------------------------------------------------------
    If
    Glcd_bOrientation = 0 Or Glcd_bOrientation = 2 ThenSwap = x0, y0 : Swap = x1, y1 ' Proton Swap command
    EndIf

    ------------------------------------------------------------------------------

    The complier throws up the error "Item is missing"

    so, I tried to change the parsing vars to ByRef.

    I get the same error.


    However, if I use the parsing var before using SWAP, it works.

    Anybody, any ideas

  2. #2
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,632
    Thumbs Up
    Received: 61
    Given: 18
    Total Downloaded
    2.27 GB

    0 Not allowed!

    Default Re: Problem with Swap command

    Have you tried the following?: -

    Code:
    If Glcd_bOrientation = 0 Or Glcd_bOrientation = 2 Then
    Swap = x0, y0 
    Swap = x1, y1 ' Proton Swap command
    EndIf
    Regards

    Joseph

  3. #3
    Junior Member pjdenyer's Avatar
    Join Date
    Jun 2014
    Posts
    8
    Thumbs Up
    Received: 2
    Given: 0
    Total Downloaded
    503.51 MB

    0 Not allowed!

    Default Re: Problem with Swap command

    Just tried that and get the same result "Item is missing!"

  4. #4
    Developer Les's Avatar
    Join Date
    Feb 2002
    Posts
    3,247
    Thumbs Up
    Received: 234
    Given: 87
    Total Downloaded
    1.50 GB

    0 Not allowed!

    Default Re: Problem with Swap command

    Please read page 382 of the Proton24 compiler's manual.

    The syntax for the swap command is Swap Variable1, Variable2. there is no equals character.

    I've tried the swap command in Proton24 and it is working as expected.
    For more example programs for Proton and Proton24 or updates, please visit: Proton WIKI or Proton Files

  5. #5
    Member Henk57's Avatar
    Join Date
    Jan 2014
    Posts
    212
    Thumbs Up
    Received: 12
    Given: 21
    Total Downloaded
    192.60 MB

    0 Not allowed!

    Default Re: Problem with Swap command

    Before or after the Swap nothing changed, so the remark after the; Swap Var1, Var2 must be wrong.

    Henk

  6. #6
    Junior Member pjdenyer's Avatar
    Join Date
    Jun 2014
    Posts
    8
    Thumbs Up
    Received: 2
    Given: 0
    Total Downloaded
    503.51 MB

    0 Not allowed!

    Default Re: Problem with Swap command

    Thanks Les - Solved! - Read the manual

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. [SOLVED !] Shift Out Command Problem
    By thetrueman in forum Proton Plus Compiler v3
    Replies: 3
    Last Post: 15th September 2009, 13:04
  2. [SOLVED !] SHin command problem
    By gunerdr in forum Proton Plus Compiler v3
    Replies: 0
    Last Post: 24th March 2009, 12:20
  3. Problem with POT command
    By richardy in forum Proton Plus Compiler v3
    Replies: 7
    Last Post: 12th June 2006, 21:44
  4. Problem with DEC command?
    By BenBarber in forum Proton Plus Compiler v3
    Replies: 2
    Last Post: 4th October 2005, 18:13

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts