Solved

QBasic - How to write to a file?

Posted on 2001-08-31
6
281 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 6

Expert Comment

by:Triskelion
Comment Utility
CJ_S::Ditto(SunBow);
0
 
LVL 54

Expert Comment

by:nico5038
Comment Utility

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
Comment Utility
Finalized as proposed

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
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.
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 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…

744 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

18 Experts available now in Live!

Get 1:1 Help Now