Solved

QBasic - How to write to a file?

Posted on 2001-08-31
6
283 Views
Last Modified: 2006-11-17
I am using RapidQ

I need a small Win GUI program that will look into a .txt Template file and Find a variable ($ProdNo)
and replace it with an inputted product number. Then save the file *AS* a new file name that I type
in.

The fields would have a drop down menu that will select which .txt file to use and the fields would
be...

"TShirt", _ tshirt.txt
"Long Sleeve", _ longsleeve.txt
"Grey Shirt", _ greyshirt.txt
"BabyDoll", _ etc...
"SweatShirt", _
"TankTop", _
"Boxers", _
"Baseball Cap", _
"Floppy Hat", _
"Mousepad", _
"11oz Mug", _
"15oz Mug", _
"Tote Bag"


Then I would go to the next field to inpput a number.

Then the last field would be what ever I decided to call the file to be SAVED AS, not overwrite.

Then a Save Button

I am looking at the whole screen size to be about 320x300 or so.

Let me know if I am not clear enough...

This is the code I have so far, I just have no clue what is needed to complete the code to make it work

CREATE Form AS QFORM
    Caption = "MultiStore Maker"
    Width = 220
    Height = 260
    Center
    CREATE Label1 AS QLABEL
        Caption = "Select Template"
        Left = 24
        Top = 56
        Width = 77
        Transparent = 1
    END CREATE
    CREATE Button1 AS QBUTTON
        Caption = "Save"
        Left = 24
        Top = 168
    END CREATE
    CREATE ComboBox1 AS QCOMBOBOX
        AddItems "TShirt", _
                 "Long Sleeve", _
                 "Grey Shirt", _
                 "BabyDoll", _
                 "SweatShirt", _
                 "TankTop", _
                 "Boxers", _
                 "Baseball Cap", _
                 "Floppy Hat", _
                 "Mousepad", _
                 "11oz Mug", _
                 "15oz Mug", _
                 "Tote Bag"
        Text = "Tshirt"
        Left = 24
        Top = 72
        TabOrder = 1
    END CREATE
    CREATE Edit1 AS QEDIT
        Text = "Enter Product Numer"
        Left = 24
        Top = 104
        TabOrder = 2
    END CREATE
    CREATE Edit2 AS QEDIT
        Text = "Enter File Name"
        Left = 24
        Top = 136
        TabOrder = 3
    END CREATE
    CREATE Button2 AS QBUTTON
        Caption = "Help/About"
        Left = 112
        Top = 168
        TabOrder = 4
    END CREATE
    CREATE GroupBox1 AS QGROUPBOX
        Caption = "MultiStore Maker v.1a"
        Left = 12
        Top = 3
        Height = 25
        TabOrder = 5
    END CREATE
END CREATE

'Insert your initialization code here

Form.ShowModal

This ia personal use program to help me exedite the updating of my webpages, not for commercial resale.
0
Comment
Question by:jefcard
6 Comments
 
LVL 22

Expert Comment

by:CJ_S
ID: 6447365
I don't know anything about RapidQ, however I do know that QBasic can write to a file like the following:
open "c:\myfile.txt" for input as #1
readall #1, mystr
close #1
'.. check the content and rewrite the variable mystr...
open "c:\myfile.txt" for output as #1
write #1, mystr
close #1

Regards,
CJ
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6447366
Concerning your last comment you might want to use a database to save your content in, and use a server side scripting language to add the data to it and retrieve the data. I personally favor ASP for this....

Regards,
CJ
0
 
LVL 24

Expert Comment

by:SunBow
ID: 6459207
Done?  While mainly I ditto CJ,
This making up of such GUIs seems more work than necessary, leading to goofy and even less manageable outcome. But of a type some market as akin helpful suite.

Can you consider alternative approach?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 6

Expert Comment

by:Triskelion
ID: 6467824
CJ_S::Ditto(SunBow);
0
 
LVL 54

Expert Comment

by:nico5038
ID: 7489585

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - PAQ'd and pts removed
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 7527933
Finalized as proposed

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now