program design help

Discussion in 'All other topics' started by bizkit101, Jun 4, 2009.

  1. bizkit101

    bizkit101 Member

    Joined:
    Sep 4, 2008
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    16
    Hello everyone,
    I need to know some information i want to know how to do something in VBScript (computer not internet), batch, and javascript.
    I want to know how to make a program that reads from a text file that says yes or no and if it says no it will do something and if it says yes it will do something else I will update the text file to say either yes or no but I do not know how to make the program. Specifically if it says no i want it to say something along the lines of: that is not available today. If it says yes I want it to open something.
     
  2. Vicious88

    Vicious88 Regular member

    Joined:
    Jan 25, 2007
    Messages:
    274
    Likes Received:
    0
    Trophy Points:
    26
    What you're going to need to do is lookup a tutorial for using INI in Visaul Basic.

    Once you know how to create an INI file and teach your program to acknowledge it, the rest pretty much comes down to IF commands.

    For a very loose example, your code might read something like:

    Code:
    If INI.Line1 = "No" then label1.caption = "That isn't available right now" Else newwindow.visible = true
    If INI.Line1 = "No" then label1.caption = "That isn't available right now" Else newwindow.visible = true
    INI files are usually very straight forward seeing as most are made using Notepad anyway. You can make Visual Basic programs that read from basic TXT files as well, but I find that certain platforms of Visual Basic (such as .NET) can sometimes overcomplicate things by being rather picky about encoding, word wrap, special characters, ect. That's not to say these problems don't exist in INI usage as well, but so far, I've been lucky enough to avoid them.
     
  3. bizkit101

    bizkit101 Member

    Joined:
    Sep 4, 2008
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    16
    Okay I understand most of it but first that is an exaple of the code right and second what is the label1.caption for is that what it is going to write or alert because I want it to alert
     
  4. Vicious88

    Vicious88 Regular member

    Joined:
    Jan 25, 2007
    Messages:
    274
    Likes Received:
    0
    Trophy Points:
    26
    That's not exactly an example script because I don't remember exactly what the command in Basic is to read from an INI, but it serves the purpose of showing you your base layout.

    Yes, the label captions are going to be label fields within your program that will display the alert "That isn't available right now".

    In order to make the command work, however, you'll need to adjust the script to where your label field (let's say you named it "Alert") is named in the script properly (example: alert.caption = "blahblahblah")
     

Share This Page