Solved

QBasic - How to write to a file?

Posted on 2001-08-31
6
288 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
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

This is an explanation of a simple data model to help parse a JSON feed
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.
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 …
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 …

756 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