Solved

QBasic - How to write to a file?

Posted on 2001-08-31
6
296 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Starting up a Project

635 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