Results 1 to 10 of 10

Thread: PseudoCode

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2004
    Location
    Scotland
    Posts
    25

    PseudoCode

    Hi guys,

    I am new to programming and have never written Pseudocode before and need some help please.

    How would you start writing a click event, a private sub and do you end with End Sub? What command words can I include?

    Does anybody have some examples to show me?

    What would I write for the following?

    VB Code:
    1. Private Sub Form_Load
    2.     txtdate = Date                                  'Disabling all text boxes
    3.     CboCustomerId.Enabled = False
    4.     TxtCustName.Enabled = False
    5.     TxtCustAddress.Enabled = False
    6.     TxtCustTelephone.Enabled = False
    7.     TxtCustHire.Enabled = False
    8.     CboVideoId.Enabled = False
    9.     TxtVideoTitle.Enabled = False
    10.     TxtVideoCopyNo.Enabled = False
    11.     TxtvideoStatus.Enabled = False
    12.     TxtHireDate.Enabled = False
    13.     TxtReturnDate.Enabled = False
    14.     TxtCharges.Enabled = False
    15.    
    16. End Sub

    VB Code:
    1. Private Sub cmdpreviouspage_Click()
    2.     frmmanagementoptions.Show                    'Showing Management Options Form
    3.     Unload frmhiresbookingsreturns               'Close Hires Bookings Returns Form
    4. End Sub

    Thanks very much for any replies!

  2. #2
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959
    An example would be to draw a command button on a form then rename the button to some name, commonly starting with cmd for a command button i.e cmdStart, in the properties at the bottom right of the IDE. Then double click the button which will produce the code,

    VB Code:
    1. Private sub cmdStart_click()
    2.  
    3. End sub

    And you add you actual code within this.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2004
    Location
    Scotland
    Posts
    25
    Sorry Jmacp,

    I probably wasnt clear enough. I have the code for the program. I need to know how to write it in plain english.

    I need to write down every procedure in the program in pseudocode. Just dont really know how to start it. The examples above are actually from the program I need to write in pseudocode.

    Thanks for your reply tho

  4. #4
    Lively Member meander's Avatar
    Join Date
    Jun 2004
    Posts
    121
    To do that you could just be like

    When cmdStart is clicked (event here eg. Open frmSecond)

    Just say what everything does like that

  5. #5
    Lively Member meander's Avatar
    Join Date
    Jun 2004
    Posts
    121
    For the code you put above you could do

    When the form is loaded disable all text boxes
    When cmdPreviousPage is clicked Show Management Options Form and Hide the Hires Bookings Returns Form

  6. #6
    Frenzied Member Spajeoly's Avatar
    Join Date
    Mar 2003
    Location
    Utah
    Posts
    1,068
    Don't get me wrong, but if you write code, you must know what it does. So commenting shouldn't be that hard of a task, would it?

  7. #7
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    Shouldn't pseudocode be written BEFORE you start typing in the code so you can plan it?
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  8. #8
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Don't take this the wrong way, but my guess is that this is your homework/project and your trying reverse engineer someone elses code.




    Bruce.

  9. #9

    Thread Starter
    Junior Member
    Join Date
    May 2004
    Location
    Scotland
    Posts
    25
    Well.............. yes, it is a project

    and............... no, its my code, ALL mine.

    I am attending college nights classes and we had to write the program. I partly blame myself for not planning it properly, but I also blame the tutor for not making us do the documentation first because it would have made it alot easier and she would have known that.

    All I wanted was for somebody to post some examples, just so I could see what it actually looked like and to see what command words I could use.

    Anyway, I have done it now so no need to post..............

    P.S. dont take that the wrong way.

  10. #10

Posting Permissions

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



Click Here to Expand Forum to Full Width