Solved

QBasic - How to write to a file?

Posted on 2001-08-31
6
287 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

789 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