Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

751.

Solve : Which language?

Answer»

My friend and I have started a little software company. I am in charge of programming, and I was wondering: I wanted to start with something simple, like a word processor. What programming LANGUAGE would be the best for this? And what language would be the easiest? Thanks.
-JohnSo you are Windows based? Cross platform? Linux?

What tools do you have at your disposal?Windows based. And, I have my computer as a tool and that's it. We also have $63... (lol). Why are you shocked?That was a SHOCK for the Linux reference.

For $63 in the BANK + a pc, I think vibhor_agarwalin or shouvik will need to advise you. Let's wait for their posts.

Do you have any software, a C compiler, anything? Are you planning to program is Basic? I don't have any compiler, but are there any free compilers? I do have MS QuickBASIC though, lol. -JohnIf you switch to Linux, there are all kinds of compilers for free.

Just a thought, and there was another shocked face!try sourceforge.net for free compilersTry MingW or Cygwin to get a compiler (GCC) and pick up your favorite tutorial and start programming!

752.

Solve : I'm trying to learn how to program can someone advise me??

Answer»

I've already programmed my calculator I know it's not much its a ti(Texas instruments)84
It is a kind of basic programming only you don't have to type the words they are in some kind of catalog.
I would like to learn how to program white a computer.
Does someone have any advise about what kind of programming I should start with,...

My computer runs with XP professional.
my dos version is v5.1 (qbasic doesn't work)Hey, I had the same question a while ago.
Have a look here and here.
Both of those topics may have some useful information for you.
Otherwise, you'll have to wait for someone else as I have no idea on programming.
But hopefully those two threads will help you a little.Most people kick off programming in something like BASIC (be it Visual Basic as people I know are learning in school (the .NET express version is free), QBasic (I think there's a free download online) or something else (I started on BBC Basic [The school was on a seriously tight budget when it came to IT])) or Pascal (though I haven't seen anyone use Pascal for a while).

A lot of people seem to be kicking up a fuss about Python (never tried it myself though).

Once you've selected a language, buy a book (on-line guides are mostly hopeless, but there are the odd good ones). You will find your book becomes well used and you will refer to it almost constantly.FIRST of all, ditch QBasic and DOS.

Visual Basic is good to get Windows applications quickly and simply and you can get the Express Edition free.

C++, C# or Java are more complicated but more powerful.

I suggest you try Visual Basic first. If you find it really easy, consider moving onto C++.This is purely my own opinions. With VB, its easy to program user interfaces and working with databases. However, its not so good if you want to learn programming. VB doesn't separate the user interfaces from the actual program itself,so to me, its considered BAD. A good programing language should also be portable across platforms, VB is not. I am a big fan of Python, so I am going to suggest OP give Python a try, as well as VB of course (other languages later). Ultimately, he will know which one suits him better. then on, he can proceed with other languages.Why is this stickied? Just wondering...I think I may have hit the sticky button by mistake. Fixed it. Find the right language for you try any language that makes you go "thats pretty cool i bet i can do that". And practice doing it JUMP in start somewhere think of things you would like to do sometimes languages are aplication based httml has ALOT of web aplications like settings for your web home page desighn basic is a common starting place for alot of programers but its what you want to do with your programing that matters. Are you a game makker or you want to be one which ever way you go you should start typing some codes. ccp will only get you so far lol:)). Vb studio and c++ express at microsoft as well as python ,Ruby ,freepacel, ant java are a few free languages.Also gamemaker has a free aplication. It's just important that you start experiencing programing yourself by doing it not just reading or cutting copying and pasting it this way you can decide if its really what you want,best regards.blo0d_ninja, I don't know what languages you have mastered, but it is clearly not English. Please don't write in one giant sentance. It is hard to read.Dude, calm down. It's a Ninja. I wouldn't mess with those. Done ,and done . Thanks for the advice. I was just trying to help .Thanks for the help I'll start with Batch files because I master some of the codes.
Is this a good idea ?I also tried Java but I can't find a righting module.

753.

Solve : AI????

Answer»

I haven't seen that program in a long time. If his / her program is open-source, you can look at TI, but if it's proprietary, you have to be extremely careful, as I wrote before...

You need to do what I need to do, Squall -- get INVOLVED iwth more of the open-source world -- there's a lot to be found at sourceforge.net.

When I wrote that it doesn't hurt to ask, I was supporting your curiosity. Perhaps you might contact the makers of Bonzai Buddy and see how much they're willing to help you.


Quote from: squall_01 on April 01, 2008, 01:12:04 PM

Theres a difference now between modify an USING some of his code. reverse engineering.
No.
Not when it is closed source.
But good luck with that...I can't cite you a specific example, Squall, but I know individuals have gotten in trouble, or at least wound up in court, because they reverse engineered software drivers for particular pieces of equipment so they could be used in the Linux world, and even though their intentions were good, they got in trouble, because the ORIGINAL writers of the proprietary code were able to show too MANY similarities between their code and what was written for Linux.Thanks to those that helped, even if you dont think it was much. I was thinking about putting him on a 2k machine w/o an internet connection. Also, I found one better then him with no malware!
754.

Solve : serial problem?

Answer»

I got a application that control my pc to test unit through serial com port 1.
but after i install the package(visual basic BOOTSTRAP)
when i click to send data, the error always "timeout error".
can somebody TELL me why?
i'm sure my pc and test unit com port are working well.
so i suspect maybe i missing files to run this test.I suspect same also. Help if you write sentances including conjunctions, EASIER read.

Is it your own application, or someone elses?this is the part1 files

[recovering space - attachment deleted by admin]part2 files
and there is another folder call, package incluse setup, and cab files (too large 9.0MB)
i can't post here.


[recovering space - attachment deleted by admin]Oh dear, i'm on dialup. I'll get back to you when it DOWNLOADS, 300 years from now.woah that downloaded surprisingly fast... now i need to know what to do with the files ...

755.

Solve : i new at Html a little help?

Answer»

i was working on a WEB page using HTML using notepad. Well i WENT to start a new one now it won't let me save it a HTML document?? What ERROR message are you getting?
Are you saving the file to a writeable location?
Are you saving it to an existing file? If so are you sure the file isn't write protected?
Your version of Windows?

If everything else fails, try saving it as a .txt file. If that succeeds then just change the file extension afterwards from .txt to .html.I have window xp media center. I went to re save it as a .HTML, all it say under save type is .txt or all files. there is another box called encoding does that have anything to do with it??Go to the Save As Window in Notepad.
In the file name box, type the name of your file followed by .html
For example: myhomepage.html
Ignore the fields called "Save as type" and "Encoding".
Your file is now saved as a .html file.ok thank you for all the helpHere's what I'm Working on









MY 5 ENTREPRENEURS


My 5 Entrepreneurs

1. Ben Cohen and Jerry Greenfield

Ben & Jerry's Ice Cream

Some Facts





  • During his senior year of high school, Ben drove an ice cream truck.

  • The two friends were born four days apart
  • A minimum net worth of $350,000, of which $80,000 must be liquid


  • [/url]
    HTTP://entrepreneurs.about.com/od/famousentrepreneurs/p/benandjerrys.htm
    ">Click Here To Read More About Them[/url]





    756.

    Solve : Opening a form in an Access Database?

    Answer»

    I'm trying to have a different form open up BASED on a selection made in a field in a currently open form.
    Example: The user has frmOrders open. There is COMBO box on the form where the user can select, for example, Toys, Baseballs, Clothes, CARS or Shoes. If the user selects Clothes, then frmTextiles should automatically open up.

    What's the easiest way to make the above happen? THANKS in ADVANCE for any help offered.
    You could test if one of items has been selected:

    if Combobox.Selected(0) = "Clothes" Then frmTextiles.Show
    if Combobox.Selected(1) = "Toys" Then frmToys.Show
    .
    .
    .

    There are other ways, some very imaginative. One would be to hide the form name in the combobox, then using a for/next loop, find the item selected and show the proper form..

    The if statements offer a brute force method, but many times simple is better.

    757.

    Solve : c# datagridview?

    Answer» OK. So i have a DataGridView with the "example1" "example2" "example3" column headers. I have searched for an answer through google but havent found anything to help me add information to the DataGridView. If someone can help me insert information into the first row of the DataGridView based on the headers, I can figure out how to insert based on array of directory files. Any Ideas? thanks.I found this on another forum but it may apply in your case.

    Quote
    I have searched for an answer through google but havent found anything

    The Help feature that came with your product is an excellent PRIMARY source of information. im afraid that didnt help too MUCH. Any other ideas.ok. I found out on my own how to do this. May not be the BEST way but, all i had to do was put my SEARCH directory code right up under InitializeComponent(); and in the foreach statement put Info.DataGirdView.Rows.Add(dir)
    758.

    Solve : Can anyone help me with a VB6 prolem please??

    Answer»

    H I have been trying to write code that will let me Save and Retrieve a list of contacts in a Visual Basic 6 Program I am WRITING for soon time now but without success - could anyone out there please help me? - my program uses Listboxs to hold the Contacts details i.e. Fore Names, Sir Names etc, the thing is I can not find a way to Save this data to a FILE on my hard drive then at the CLICK of a button in my vb6 program, retrieve it and display it in it's listboxs, please help.

    Thank in advance Dobby Many times it's easier to let somebody else explain something. Note: You need to download the example.

    Good luck and welcome to CH.

    759.

    Solve : Date Calculations in Access?

    Answer»

    How do I adapt the FOLLOWING so that the "new date" ignores Saturday and/ or Sunday? For example: the user SELECTS April 7 from a calendar control. He/she wants the new date to be 5 business days from the date selected. The new date should be April 14 because 5 business days from April 7 should not consider Saturday and Sunday as business days.

    Dim FirstDate As Date
    Dim IntervalType As String
    Dim Number As Integer
    Dim Msg
    IntervalType = "d" '"d" specifies days as interval
    FirstDate = Calendar1
    Number = InputBox("Enter number of days to add")
    Msg = "New date: " & DateAdd(IntervalType, Number, FirstDate)


    I'm also trying to figure out how this would apply to ignoring holidays (I have a holiday table).First I would setup a WeendEnd Function:

    Code: [Select]Function IsWeekend(dt)
    Select Case Weekday(dt)
    Case vbSaturday, vbSunday
    IsWeekend = True
    Case Else
    IsWeekend = False
    END Select
    End Function

    Your code is then something like this:

    Code: [Select]busday = 'use the value from the date picker control
    tot = 0

    Do until tot = 5
    busday = dateadd("d", 1, busday)
    if IsWeekend(busday) = False
    tot = tot + 1
    end if
    Next
    Msg = "New date: " & busday

    The theory is the same with holidays. Just check if the new busday is a holiday and ignore the tot counter.

    760.

    Solve : lost passwords?

    Answer»

    Can anyone help me? I have bought a new desktop at a auction and it is password protected.

    what is the BEST and easiest way to skip or overwrite the current password.

    helppppppp When someone asks for advice on circumventing a password we have no way of KNOWING whether the person is the rightful owner of the computer or not. THEREFORE we generally do not give advice on circumventing passwords.
    But I can tell you this.
    If it is the Windows password (a password at the Windows login screen) then I suggest you format the hard drive and reinstall Windows. In fact you should ALWAYS do this when buying a used computer. There is no way of knowing what the previous owner might have installed on the computer.
    If it is the BIOS password (a password you need to enter just after you power on the computer) then you will need to take the laptop to a technician that can service the laptop brand in question. BIOS passwords on laptops cannot EASILY be removed.
    Alternately you could try contacting the seller and get the password from him/her.

    761.

    Solve : C++ Tutorials?

    Answer»

    does anyone have any GOOD C++ tutorial LINKS? i am trying to LEARN it, so thank youHere

    Good LUCK.

    762.

    Solve : c# if radio button select then?

    Answer»

    I have a radio button that is selected with

    Code: [Select]InitializeComponent();
    DOCUMENTS.Select();

    I would put more code under it, but im stuck with trying to figure how to do an if(docuMents is selected){}. Can anyone help? I don't know much about C# but I would think a radio button would have a checked PROPERTY.

    Code: [Select]if radiobutton.checked then ...

    What software are you using for your program development?


    Im using sharpdevelop.....radiobutton.select does select it like I want it too, i SUPPOSE i can try using checked but either way I DONT have a problem selecting it, just a problem writing an if/then statement for it.I'm thinking select is a method, checked is a property. Use the checked property (true/false) to determine the status of the radio button.

    Not sure of the syntax but something like:

    if radiobutton.checked = true then do something
    if radiobutton.checked = false then do somethingelse

    Does SharpDevelop have intellisense or auto-completion? That might prove HELPFUL on listing the properties and methods for a radiobutton.



    cool thanks.....this worked

    Code: [Select]docuMents.Select();

    if (docuMents.Checked = true){

    763.

    Solve : vb.net treeview help?

    Answer»

    hi all,

    I'm trying to create a explorer type treeview which shows all the drives on the machine and all the folders within them as CHILD objects.

    the problem I have is that I seem to be unable to create a child object for a node that I've already created.



    PRIVATE Sub tv1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles tv1.GotFocus

    'makes 'my computer' start node and sets up for child nodes to be added below
    With tv1.Nodes.Add("My Computer").Nodes


    'for each computer drive avaiable, LIST as a child under my computer
    For Each drive_info As System.IO.DriveInfo In System.IO.DriveInfo.GetDrives()


    'add child nodes to my computer, drives. c, d, e, etc...
    drive = drive_info.Name
    .Add(drive)


    'maybe a for each loop here, for each folder that exists in the drive, add child node



    Next drive_info


    End With

    End Sub




    Also, I have to select the treeview before it DISPLAYS any of my infomation. what can i REPLACE the tv1_GotFocus with so it displays as soon as the app is run.

    cheers in advance
    Try zeroing on which parent you're referring to. (yes I know there is only one). The snippet does not rely on the With you wrote.

    Code: [Select]'for each computer drive avaiable, list as a child under my computer
    For Each drive_info As System.IO.DriveInfo In System.IO.DriveInfo.GetDrives()
    'add child nodes to my computer, drives. c, d, e, etc...
    drive = drive_info.Name
    tv1.SelectedNode.Nodes.Add(drive)
    Next

    Quote

    Also, I have to select the treeview before it displays any of my infomation. what can i replace the tv1_GotFocus with so it displays as soon as the app is run.

    Any chance you can put your logic in the Form_Load event? Both the TreeView and the Form have scores of events to choose from.
    764.

    Solve : Perl?

    Answer»

    I know that Java is BASED on this principle:
    "Java should allow the same program to be executed on multiple operating systems."

    I know that C++ does not comply with this statement. But does Perl?No.
    Java accomplish being cross platform by running its code in a virtual machine called the JVM. In ORDER for Java to run on a given platform a platform compatible JVM must be written.
    Only other mainstream programming framework I know that uses a VM is the .NET framework.I think that Perl is HIGHLY cross-platform though, because you can use GUI interfaces that are made in Windows, exactly the same on a UNIX machine...Quote from: Prentitious on April 12, 2008, 06:50:11 AM

    I think that Perl is highly cross-platform though, because you can use GUI interfaces that are made in Windows, exactly the same on a Unix machine...
    what one needs is the "interpreter". You can write perl scripts in windows, and bring it to run in *nix and run it with little/minimal changes. Others like Python,Java,Ruby,Php etc are all cross platform, all thanks to the interpreter.
    765.

    Solve : COM objects?

    Answer»

    Hii
    I am trying to create COM objects in C with the help of a tutorial I found on net.
    But I am finding it difficult.
    Is there any other way of creating a COM object?
    If there is, please let me know.
    Thanks.You can create COM objects in VBScript. The script56.chm file will have all the details. Look for Component when you open the file.

    You can either SEARCH for the file on your own SYSTEM, it came free with your Windows or download it from the link.

    In addition you can download the Script Component Wizard which automates the XML portion of the component and assigns a classid. You still have to write the actual logic and don't forget to REGISTER your component so you can use it in your scripts!

    If you're looking for a project, VBScript has no NATIVE sort FUNCTIONALITY. hello
    try this link "http://www.codeproject.com/KB/COM/com_in_c1.aspx#VTABLE"
    COM objects are descriped from the root.

    bi

    766.

    Solve : Maximise Window.?

    Answer»

    I am writing a C program and I want that when I run the code, the window maximises itself automatically. Is there any function or command which I can use?

    Thanks Learn something new every day. Always thought the C++ had the windows not C.

    Code: [Select]ShowWindow(hWnd,SW_SHOWMAXIMIZED)

    hWnd would be the window handle

    Good luck. Thanks a lot SIDEWINDER. It should work.

    But how should I set the window handle ?Wait a minute Sidewinder.
    I think you MISUNDERSTOOD my question. Let me explain myself a bit better.

    I wrote a C program which runs in a DOS prompt window. But the window is set by default to be 25 characters in height, i.e. it is not completely maximised. I would like a command which can maximise the command prompt window automatically.

    Hope this is a better explanation.

    Thanks again for your interest. OK, this has nothing to do with C and everything to do with the command prompt.

    Try STARTING your program and use the /max switch to CONTROL the window size:

    Code: [Select]start /max C-program

    Good luck. As, I said C and C++ programming language. While writing a program
    and I want that when I run the code, the window maximizes itself automatically. Is there any function or any short cut to Maximize.

    _______________________________________ ____

    priya1

    [link Removed - please do not advertise other websites]Quote from: priya1 on August 29, 2008, 01:12:01 AM

    As, I said C and C++ programming language. While writing a program
    and I want that when I run the code, the window maximizes itself automatically. Is there any function or any short cut to Maximize.

    The question is ambiguous. What window? The program window or the command window. Either way the question has been asked and answered.

    If it's the program window, see reply #1 above.
    If it's the command window, see reply #4 above

    767.

    Solve : UI?

    Answer»

    I'm trying to give my "Macilizer" a CONFIGURATION UI......just a regular windows message box with 3 check boxes, descriptions for each, and a SAVE button instead of an OK button..... that could be run to configure what is to be run..

    check boxes would read:
    (box) Battery Meter
    (box) Konfabulator
    (box) Object Dock

    ...and checking or RECHECKING would add or REMOVE the entries one by one:
    Code: [Select]
    echo Starting Battery Meter
    ping -n 1 -w 2000 1.1.1.1 >nul
    start "" "C:\Program Files\Mioplanet Battery Meter\Mioplanet Battery Meter.exe"


    echo Starting Konfablator
    ping -n 1 -w 2000 1.1.1.1 >nul
    start "" "C:\Program Files\Pixoria\Konfabulator\YahooWidgets.exe"


    echo Starting Object Dock
    ping -n 1 -w 2000 1.1.1.1 >nul
    start "" "C:\Program Files\Stardock\ObjectDock\ObjectDock.exe"

    from the final .bat file
    Code: [Select]@echo off
    title Macilizer
    echo Macilizer starting...
    ping -n 1 -w 2000 1.1.1.1 >nul
    echo INITIALIZING...
    ping -n 1 -w 500 1.1.1.1 >nul
    Choice /M "Do You Want To Run Mac Look-Alike Programs?"

    If %errorlevel% EQU 2 goto no
    If %errorlevel% EQU 1 goto yes

    :yes
    echo Starting Battery Meter
    ping -n 1 -w 2000 1.1.1.1 >nul
    start "" "C:\Program Files\Mioplanet Battery Meter\Mioplanet Battery Meter.exe"
    echo Starting Konfablator
    ping -n 1 -w 2000 1.1.1.1 >nul
    start "" "C:\Program Files\Pixoria\Konfabulator\YahooWidgets.exe"
    echo Starting Object Dock
    ping -n 1 -w 2000 1.1.1.1 >nul
    start "" "C:\Program Files\Stardock\ObjectDock\ObjectDock.exe"
    ping -n 1 -w 2000 1.1.1.1 >nul
    echo Exiting....
    ping -n 1 -w 2000 1.1.1.1 >nul
    exit

    :no
    echo Exiting....
    ping -n 1 -w 2000 1.1.1.1 >nul
    exit

    can this be done........somewhat/remotely.............easily?


    I do have Adobe Photoshop and Flash if I had to create a box, but i would need help to code it

    768.

    Solve : regarding programing?

    Answer»

    i have one problem. (how to make button in swing which come in a single column,and gap in EVERY button like
    .....................button 1...............

    ....................button2............ .......

    .....................button3........... .......



    ....plz give the solution...you can try this code.,.,. i cant give you the full JAVA Source codes of your problem,.,.,
    but you can, make my code as a sample.,.,/* A program that ddetermined if the SECOND Number is a MULTIPLE of the first
    * Programmer: Reynante C. Tancio
    * Proram Title: Multiple.java
    */

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;



    public class Multiple extends JFrame {

    int num1;
    int num2;

    private JLabel numLabel,Labelnum;
    private JTextField numField,Fieldnum,print;
    private JButton testButton;


    public Multiple() {

    super( "\t MULTIPLE NUMBERS" );

    Container tanz = getContentPane();

    tanz.setLayout( new FlowLayout() );

    numLabel = new JLabel( "First integer:");
    numField = new JTextField(4);


    tanz.add ( numLabel );
    tanz.add ( numField );


    Labelnum = new JLabel( "Second integer:");
    Fieldnum = new JTextField(4);
    tanz.add ( Labelnum );
    tanz.add ( Fieldnum );


    testButton = new JButton("Test");
    testButton.addActionListener(
    new ActionListener() {
    public void actionPerformed( ActionEvent e ) {

    String num1,num2;
    int n1, n2;

    num1 = numField.getText();
    num2 = numField.getText();

    n1 = Integer.parseInt(num1);
    n2 = Integer.parseInt(num2);


    if ( n2 % n1 == 0 ) {

    print.setText("The second number is multiple of the first.");

    }


    else {
    print.setText("The second number is not a multiple of the first.");
    }
    }
    }
    );


    tanz.add(testButton);

    print = new JTextField(25);
    print.setEditable (false);
    tanz.add(print);


    }


    public STATIC void main ( String [] reynz ) {

    Multiple my = new Multiple();

    my.setSize(300,150);
    my.show();

    }

    }


    no try = no how

    769.

    Solve : pls help me.........C++ programming?

    Answer»

    something is wrong in my program....why that it only outputs (INVALID gender)
    can someone help me FIX this program........i really need to finish my homework today....
    i really this program to run properly.....

    this is the problem:





    Rewrite the program developed below so that the function MAIN is merely a collection of function calls. Your program should use the following functions.
    a. Function openFiles: This function opens the input and output files, and sets the output of the floating-point numbers to two decimal places in a fixed decimal format with a decimal point and trailing zeros
    b. Function initialize: This function initializes variables such as countFemale, countMale, sumFemaleGPA, and sumMaleGPA.
    c. Function sumGrades: This function finds the sum of female and male students' GPA's
    d. Function averageGrade: This function finds the average GPA for female and male students.
    e. Function printResults: This function outputs the relevant results.
    f. There can be no global variables. Use the appropriate parameters to pass information in and out of functions.

    /* For research purposes and to better help students, the admissions office of your local university wants to know how well female and male students perform in certain courses. You receive a FILE that contains female and male student's GPA's for certain courses. Due to confidentiality, the letter code f is used for female students and m for male students. Every file entry consists of a letter code followed by a GPA. Each line has one entry. The number of entries in the file is unknown. Write a program that computes and outputs the average GPA for both female and male students. Format your results to two decimal places.
    */

    #include
    #include
    #include

    void main()
    {
    ifstream inData;
    char gender;
    FLOAT average_gpa, sum_gpa = 0, gpa;
    int count = 0;

    inData.open("GPA_Detail.dat");
    if(!inData) {
    cout<<"Cannot open input file. Program terminates!!!\n";
    }

    cout<<"Processing data...\n";
    inData>>gender>>gpa;
    count++;
    while(!inData.eof()) {
    sum_gpa += gpa;
    inData>>gender>>gpa;
    count++;
    }

    average_gpa = sum_gpa / count;
    cout< cout<<"The average gpa is " <
    inData.close();
    }


    ########################################################
    for now.....this is my progress..pls help me....




    #include
    #include
    #include
    using namespace std;
    void OpenFiles(char ch, float gpa);
    void initialize(int fcount, int mcount, float fgpa, float mgpa);
    void sumGrades( int fcount, int mcount, float fgpa, float mgpa);
    void averageGrades(float avfgpa, float avmgpa);
    void printResults(int fcount, int mcount, float avfgpa, float avmgpa);
    int main()

    {
    ofstream out;
    ifstream in;
    char ch;
    float gpa;
    float avfgpa;
    float avmgpa;
    int fcount, mcount;
    float fgpa; //define female GPA
    float mgpa; //define male GPA

    initialize (fcount, mcount, fgpa, mgpa);

    OpenFiles(ch, gpa);

    while(!in.eof())
    {
    sumGrades(fgpa,mgpa,fcount,mcount);
    in>>ch>>gpa;
    averageGrades(avfgpa, avmgpa);

    }


    printResults(fcount, mcount, avfgpa, avmgpa);

    }

    void OpenFiles(char ch, float gpa)
    {

    ofstream out;
    ifstream in;
    in.open("GPA_Detail.dat",ios::out | ios::ate);
    if (!in)
    {
    cout<<"Can not open input file"<cout<<"program terminates!!"<}
    in.get(ch);
    in>>gpa;
    in.eof();

    out.open("GPA_Detail.dat",ios::out | ios::ate);
    out<out<//out<<"Female" <
    }

    void initialize(int fcount, int mcount, float fgpa, float mgpa)

    {

    fgpa = 0.0;
    mgpa= 0.0;
    fcount = 0;
    mcount = 0;
    }

    void sumGrades(int fcount, int mcount, float fgpa, float mgpa)
    {

    char ch;
    float gpa;
    OpenFiles(ch, gpa);
    switch (ch)
    {
    case 'F':
    case 'f': fgpa = fgpa+gpa;
    fcount++;
    //avfgpa = fgpa/fcount;
    break;
    case 'M':
    case 'm': mgpa = mgpa + gpa;
    mcount++;
    //avmgpa = mgpa/mcount;
    break;
    default: cout<<"invalid gender"<return;
    }

    }

    void averageGrades(float avfgpa, float avmgpa)
    {

    float fgpa, mgpa;
    int fcount, mcount;
    sumGrades(fcount, mcount, fgpa, mgpa);
    avfgpa = fgpa/fcount;
    avmgpa = mgpa/mcount;
    }

    void printResults(int fcount, int mcount, float avfgpa, float avmgpa)
    {
    ofstream out;
    out<<"Number of female ="<out<<"Average female GPA = "<out<<"Number of male ="<out<<"Average male GPA ="<out.close();
    }



    770.

    Solve : boot loader and Kernel info?

    Answer»

    I was wondering how a boot loader and kernel works. I would like a general view of it, not specifically how linux kernel works like google brings up. how does the boot loader find the kernel? What are the most important areas of a computer that the kernel accesses and REGISTERS to make it work (do the minimum, but still work)?Have you heard of "books"?Quote from: zaryk on July 14, 2008, 02:28:59 PM

    how does the boot loader find the kernel?

    The boot loader is a machine code program. It is written to look in a standard location for named files.

    Quote from: zaryk
    What are the most important areas of a computer that the kernel accesses and registers to make it work (do the minimum, but still work)?

    Sounds like HOMEWORK, hence my previous remark.


    Yeeaaaa, you are right it is homework? Mental Homework. To research and study it, and one day make it. You, the World, is my teacher, and you will judge it. But, school related, I don't have any computer classes.first the computer is all like, "hey, there a boot sector with valid data in the shizzouse?" and the boot sector is all like, "WASSAP!" and then the computer reads the boot sector, which complains about being tickled. The boot loader looks in predesignated locations (usually on the root of the drive, because most boot loaders are too small to include directory traversal abilities), so, then it loads the OS, and the OS is all like, "hey d00ds!" to all the hardware:

    Video Card:mmm, colours.

    network card: must talk. Must network. Socialize. OPEN THE CONNECTION! LOAD MY DRIVER!

    Sound Card: Hey, you guys ever met my aunt santa cruz? Man, she's a big one, but she makes a darn good pie, if you ask me. Why I remember this o....

    Chipset: Shut up already, god, you're always making sound.

    Sound Card: It's what I do. Hey, anybody got an IRQ?

    Chipset, oh yeah, here I'll give you guys some. OK, Video Card

    Video Card: What up?

    Chipset: You're gonna be IRQ 9

    Video Card: Aww man. OK.

    Chipset: Network card? You'll be IRQ12.

    Network card: OK. can I start communicating yet?

    Chipset: Timer, you'll be IRQ 0, but you know that, you're always IRQ 0.

    Timer: Took you long enough. You know I'm timing you.

    Chipset: Ok, now whats left here- parallel port at IRQ 7, Com ports at addresses 0x...

    Sound Card: Hey, I want an IRQ!

    Chipset: Oh yeah, I forgot about you- hmm, I guess you'll share a IRQ with the network card, IRQ 12

    Network card:hey buddy.

    Sound Card: I ain't sharin with a stinking network card! what if I get Networkually transmitted diseases?

    Network card: Don't worry, I've got protection, a Firewall. Might hurt a bit though.

    Computer: stop you're squabbling! The boot loader wants to issue some commands!

    Boot loader: Hard Drive. load NTLDR.

    Hard Drive: you are NTLDR. Burp.

    Boot Loader: ACK! you've burped on the drive!

    Hard Drive: BAH, it's wasn't important, just user data.

    Boot Loader: Oh ok, try not to damage my files though.

    Hard Drive: I really should not have talked to that USB enclosure. I think I caught something.

    HDD interface: What! you've been cheating on me?

    Hard Drive: uhh, Not this again. Hey, the DVD drive is a lot more promiscuous then I am, and I don't hear you complain to him!

    HDD Interface: Don't make excuses, the DVD drive also uses removable media.

    DVD Drive: yeah, there is one in here to. looks like a XP CD.

    Boot loader: woah woah- hold on a sec- a XP CD?

    DVD Drive: yeah- it's shiny. I'll spin it faster for no reason.... psychedelic!

    Boot loader: Ok ok, well let's get on with this- Hard Drive! load the OS, just like last time.

    HDD: OK.

    ...
    ...
    ...
    Boot Loader: what are you doing?

    HDD: oh, sorry, I detected a SMART error. what were you saying?

    Boot Loader: of course their is a SMART error, because your STUPID! now load the OS.


    and FINALLY after the POST, the boot begins. Of course that whole discussion (or more precisely, a more verbose version of it) occurs everytime the computer boots! what fun!haha love the personification. Cool, thanks.Wow- I read my own post and laughed my *censored* off. That is so sad, and yet endearing at the same time.Quote from: BC_Programmer on August 17, 2008, 01:54:12 PM
    Wow- I read my own post and laughed my *censored* off. That is so sad, and yet endearing at the same time.

    I agree about the sad part, not so sure about the endearing. "Profoundly irritating" was the phrase that sprang into my mind.

    I can't believe you wrote this

    Quote
    and the OS is all like, "hey d00ds!"



    Not wishing to be offensive, but your post was so, er, North American...


    I was writing that way for comedic EFFECT, because people that talk that way piss me off. "And I was all like" "and he was like"

    LIKE WHAT? a weasel? a paint can? like is for comparisions people! NOT as a random word to lengthen sentences unnecessarily.

    Boy they piss me off too. People who say that everything is "awesome" get on my *censored* too.
    771.

    Solve : Learning Java?

    Answer»

    I am just starting to LEARN Java for use in automating some CAD programs and am wondering where to get STARTED. Is there a particular SDK that would be useful with learning Java or some starter hints or tips that you can share? I have programming experience in VBA and C# but am not a programmer. Most of the code that I have written is fairly STRAIGHTFORWARD and has been used to automate either a control system or a program execution. Any help is greatly appreciated as I am trying to FIGURE out where to start.
    Thanks in advance for your help.
    SEBWell, in order to develop programs in Java, you will need the Java SDK. Click on the download button in the JDK 6 update 7 box.I like to use Jext http://www.jext.org to code my (rudimentary) Java programs. Check it out. It's a great editor for TONS of languages, the Hypertyper ADDON is great, too. Good for saving time.

    -rock

    772.

    Solve : Java Heap Overflow question?

    Answer»

    I'm writing a PROGRAM that creates a two dimensional ARRAY of x by y sizes.
    At large numbers for both x and y (5000 for example), the program crashes and has a OutOfMemoryError: Java Heap Size. I don't remember the exact error, but that's very close.

    My question is:
    How do I tell the program to increase the application's heap size upon starting without forcing command LINE input. ie: is there a line of code to increase the heap size before anything else executes inside the java program.

    As a sidenote, my program is run from/in the console, if that makes any difference.

    I have a vague knowledge of -Xmx and -Xmn but as far as I know, those are a system setting that has to be SET by the user at runtime via the command line.

    Thanks for any help.
    -rock

    773.

    Solve : exe files?

    Answer»

    is it possible to change an exe file to appear as a jpg or ppt file but it still be opened and executed when sent as an attachment? Almost all mail servers and mail programs block emails with .exe files. What I do is change the extension and TELL the recipient to RENAME the file. For example, if I wanted to email the file "mail.exe," I would change it to "mail.ghy," send it, and, in the email, instruct the recipient to rename the file to "mail.exe."It seems that you want to make a virus or some malware Quote from: qinghao on September 03, 2008, 11:29:17 AM

    It seems that you want to make a virus or some malware
    actually i purchased a spyware program to install on my LAPTOP pc that travels with other people. i need to send it remotely in an email and disguise it as a different file type if possible. i own the target computer and the persons using it need to be monitored uknowingly and i do not have physical access to it.It is illegal to monitor a person in such a manner, and we can not help you "spy" on anyone. Sorry.

    Besides, the methods you are describing wouldent work anyways. If you made a EXE into a JPEG file, you would just get an error opening describing that the file was the wrong format and could not be opened or MAY be CORRUPT.
    Thanks, Zylstra.

    For the record, my above post is a means to transmit, via email, legal .exe files to knowing persons.

    Further, to qinghao - you were right on.
    774.

    Solve : Input Output C++?

    Answer»

    any ideas on how to INPUT and OUTPUT a microsoft ACCESS file??Not familiar with C++ notation, but in general you need a CONNECTION object, a recordset object, a string element that holds a provider TEMPLATE and a string element to hold the SQL statements.

    More information here.

    Good luck.

    775.

    Solve : C++ struct program?

    Answer»

    Hi guys
    I actually have this assignment that I have to complete:

    Write a C program to ASK the user to input an arithmetic expression and store the expression in an array of t records containing the expression, its value and level of difficulty.The user can terminate the input by just pressing <ENTER>
    After inputting , the program will print out all the expressions and their level of difficulty entered by the user.


    This is my program code:
    #include
    #include
    #define SIZE 10

    struct game{
    char exp[10];
    short value;
    short level;

    }quest[SIZE];


    void main(){
    int count,i;
    for(count=0;countprintf("Please enter the expression:");
    scanf("%s \n",?[count].exp);
    printf("Please enter the value of the expression:");
    scanf("%d \n",?[count].value);
    printf("Please enter the level of difficulty:");
    scanf("%d",?[count].level);
    if(quest[count].exp != '\n');
    break;
    }

    for(i=0;iprintf("%c %d %d \n",quest.exp,quest.level);
    }


    }


    And belive me I have tried but this just doesn't seem to be working before at least it printed out the first three statements took the input but now it's nowt even doing that it just prints the first statement after that no matter how many times you press enter it doesn't work!!!!
    Please see if you can help me sort it out immediately...it's due tom!!!!THX

    We don't do homework on this site. The official reasoning goes something like this:

    Quote

    If I give you the answer, and you submit it as your own work, your teacher may wrongly think that you are doing fine on the course, and you won't get the remedial attention and extra encouragement you so clearly need. This board does not do lazy kids homework for them.
    Courtesy: Dias de verano

    Of course you and I both know that is a load of crap. This is not about you, it's about us. The real reason ( ) is that we can't risk giving you a WRONG answer. What if our answer gets you an F? Now, one F in the course of a lifetime is hardly fatal, but imagine our humiliation. How could we ever face the CH membership again? Can you possibly imagine the shame of being stripped of our rankings and starting over as a low-life? Well, can you?

    Now BUCK up, do your own homework and get the grade you deserve.
    776.

    Solve : kCopying Batch files, and Renaming without the Extension...?

    Answer»

    Hi, I recently began making some batches to HELP me in my work, and I'm having a problem since I want to remove the file extension from my copied file's new name:

    @echo off
    cd C:\teste2
    set Day=%Date:~0,2%
    set MTH=%Date:~3,2%
    set Yr=%Date:~6,4%
    set Hr=%Time:~0,2%
    set Min=%Time:~3,2%
    set Sec=%Time:~6,2%

    copy *.pdf "C:\teste\*_%Day%%Mth%%Yr%_%Hr%%Min%%Sec%.pdf"

    It simply copies all the pdf files from the folder " C:\teste2" and renames it with the CURRENT Date and Time, but it also comes with the extension, example: "renamedfile.pdf_03092008_131200.pdf"
    and I dont want the the "pdf" in the middle of the name.Code: [Select]@echo off
    cd C:\teste2
    set Day=%Date:~0,2%
    set Mth=%Date:~3,2%
    set Yr=%Date:~6,4%
    set Hr=%Time:~0,2%
    set Min=%Time:~3,2%
    set Sec=%Time:~6,2%
    for %%V in (*.pdf) do copy "%%V" "%%~nV_%Day%%Mth%%Yr%_%Hr%%Min%%Sec%.pdf"


    O.o Thanks it worked just fine Now I'm having another problem...
    I need to have the old files that were being renamed the WRONG way (with the ".pdf") back to normal. Is there any way to create a batch that simply gets all of them and removes the string ".pdf"?

    777.

    Solve : qbasic?

    Answer»

    How can i invoke the qbasic screen from DOS if qbasic.exe is in :
    1.qbasic directory.
    2.the ROOT directory.
    3.qbas directory.
    4.qbx directory.
    5.what is the impact of program developement in computing TECHNOLOGY?Welcome to the CH forums.

    Homework we do not do here, please REFER to your tutor.

    Good luck

    778.

    Solve : Outline Control (MSoutl32)?

    Answer»

    Hello, I want to show in a tooltiptext the info signed on the TEXT contained in the Ouline control. The point is that I want to show it without select it.

    Cheers You will have to research what properties of the control are exposed. Most controls show the tooltip during a mouseover or mousehover event. Tooltips are also on a timer and show for a limited time interval.

    Quote

    The point is that I want to show it without select it.

    Why would you do this?

    Well, basically is a client requirement. I know that the mouseover method shows this, but I have to select the item to show the information in the ToolTip (The tooltip shows the selected text). But the point is that I want to show the text in the tooltip without select the text. Is it possible?

    CheersQuote
    I know that the mouseover method shows this, but I have to select the item to show the information in the ToolTip

    I'm misunderstanding this. By select you do mean click, right?

    Quote
    But the point is that I want to show the text in the tooltip without select the text. Is it possible?

    I suppose you could use any of the mouse move events or EVEN the timer event with the tooltips APPEARING carousel style. From a design view, this could get messy. From experience, users don't like surprises.

    It always seemed reasonable when designing a Windows program not to DEVIATE much from the Windows standards. While this could make for some BORING interfaces, the user would more intuitively learn the program.



    PS. How did you make out with Crystal Reports?ToolTipText without select the item contained in the Outline control. But don't worry, I think it couldn't work by this way.

    Best Wishes and thanksok i dont have idea about ur topic!!!Quote from: garydeen on September 09, 2008, 06:26:54 AM
    ok i dont have idea about ur topic!!!

    Garydeen, this is a week old topic and stop posting if you don't about the topic.
    779.

    Solve : Visual Basic 6 and Crystal Reports 2008?

    Answer» HELLO, I'm trying to use the crpe32.dll which is included on the Crystal Reports 2008 VERSION on my VB6 project. How could I do to make this possible?

    Is it some special condition to do to LINK this Dll?

    Regards Quote
    I'm trying to use the crpe32.dll which is included on the Crystal Reports 2008 version on my VB6 project

    Use it for what? Did you install Crystal Reports? This tutorial may be helpful.

    Crystal Reports is a third-party add-on (from Seagate) that will hook into your VB installation.

    Edit: Check out this page for how to make the declarations within your VB program, however most of the functions are encapsulated within the CrystalReport1 object.

    Thanks a Lot. I was seeking by the WEB and I found that the Crystal Reports 2008 is only compatible with the Visual Studio.Net Versions

    Best RegardsVB 6.0, has DATAREPORT.,. you can try that.,., and in much easier way.,., VB 6.0, has DATAREPORT.,. you can try that.,., and in much easier way.,.,Yes u should try dis one!!!!
    Thanks a Lot. I was seeking by the web and I found that the Crystal Reports 2008 is only compatible with the Visual Studio.Net Versions

    Best wishes
    780.

    Solve : Passing variables between forms in vb.net?

    Answer»

    I have a programming background, but I am new to vb.net. I am working on my first real vb.net project and I have a listview on the main form (Form1). I have a button the user can click on to open a new form that I want to have the listview from Form1. The new form has some fields to add values to the listview, and when the user clicks on OK in the new form, I want the new information to show back up in the listview on the original form.

    So I am thinking I need to pass a pointer to the address of the listview to the new form ... or something like that?

    I have the listview and adding values part working in the new form, but I can't figure out how to get the new form to start off with the Form1 values, and then how to get the updated values back to Form1.This used to be so simple in VB6. One method is to create a module where you can create a public instance of each form.

    Module:
    Code: [Select]Module Module1
    Public FForm1 As New Form1
    Public FForm2 As New Form2

    Sub Main()
    FForm1.ShowDialog()
    End Sub
    End Module

    Once that's out of the way, you can reference the controls on either form:

    Form 1
    Code: [Select]Public CLASS Form1
    INHERITS System.Windows.Forms.Form

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    FForm2.Show()
    End Sub
    End Class

    Form 2
    Code: [Select]Public Class Form2
    Inherits System.Windows.Forms.Form

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim lvi As New ListViewItem(FForm2.TextBox1.Text)

    FForm1.ListView1.Items.Add(lvi)
    FForm2.Hide()
    End Sub
    End Class

    The last thing is to untick the enable application framework box in the application properties screen and POINT the startup object to the module name.

    Hope this helps Thanks, Sidewinder! I will TRY it shortly and let you know how it goes.I think you should refer to computer experts so that you can have GREAT comments!!-

    781.

    Solve : c++ programming:?

    Answer»

    Hi,

    when I compile the code below, I get the following ERROR messages:

    [linker error] undefined REFERENCE to `sample_class::UsingFile'
    ld returned 1 exit status
    [Build Error] ["Class] Error 1



    How do I solve this problem? Thanks.



    Code: [Select]class sample_class
    {

    PUBLIC:
    sample_class()
    {
    UsingFile = 0;
    }

    ~sample_class()
    {
    --UsingFile;
    }

    static bool IsFileInUse();


    private:
    static int UsingFile;

    };



    bool sample_class::IsFileInUse()
    {
    if(UsingFile != 0)
    {
    cout &LT;< "File in use" << endl << endl;
    return (true);
    }

    }


    int main(int argc, char *argv[])
    {


    SYSTEM("PAUSE");
    return EXIT_SUCCESS;
    }

    782.

    Solve : C++ minor problem?

    Answer»

    hey guyz
    im trying to make an 'if' statement and im experiencing problems
    this is my CODE so far;

    if (choice == 1);
    cout << "You picked Gum! \n Now ENTER what brand of Gum you want \n 1. Hubba Bubba \n 2. Extra \n 3. Juicy Fruits" << endl;
    cin >> choice;

    if (choice == 1);
    cout << "You have bought Hubba Bubba! \n Please pay: $" << Hubba_Bubba << endl;

    if (choice == 2);
    cout << "You have bought Extra! \n Please pay: $" << Extra << endl;

    then when i run program and enter choice 2, i get choice 1 showing on programing stating the cout statement that i bought choice 1 when i picked 2, followed by choice 2

    what i want is to somehow not show choice 1 if 2 is selected, i was thinking of using 'void' but im not surehow to incorporate it.

    also i havent defined choice 2, im hoping that by using cin >> choice , any 'int' entered can be recalled by using if (choice == '?') am i on the right track? because i got alot more codes to write :s

    thanksok guyz dont worry that was really dumb of me haha
    i fixed it, for others wondering it was a ';' problem

    problem

    if (choice == 1);
    cout << "You picked Gum! \n Now enter what brand of Gum you want \n 1. Hubba Bubba \n 2. Extra \n 3. Juicy Fruits" << endl;
    cin >> choice;

    if (choice == 1);
    cout << "You have bought Hubba Bubba! \n Please pay: $" << Hubba_Bubba << endl;

    if (choice == 2);
    cout << "You have bought Extra! \n Please pay: $" << Extra << endl;


    solution

    if (choice == 1)
    cout << "You picked Gum! \n Now enter what brand of Gum you want \n 1. Hubba Bubba \n 2. Extra \n 3. Juicy Fruits" << endl;
    cin >> choice;

    if (choice == 1)
    cout << "You have bought Hubba Bubba! \n Please pay: $" << Hubba_Bubba << endl;

    if (choice == 2)
    cout << "You have bought Extra! \n Please pay: $" << Extra << endl;


    LOL sorry for wasting post, but it took me like 3 HOURS to figure this little problem out :s
    haha
    have you TRIED switch instead of laddered Ifs?Not sure how to use a switch, can you give me an example please???

    thankswoops- never mind- switch wouldn't be much cleaner then what you have now, since your not really choosing from a wide variety of options- just 1 for gum and a few options below it? or is this gum selection stuff just a small part of the number of choices?

    I dont have idea about ur problem pls ask any computer experts about ur problem!!!!!!!!!!
    Quote from: garydeen on September 09, 2008, 06:21:13 AM

    I dont have idea about ur problem pls ask any computer experts about ur problem!!!!!!!!!!


    the problem was solved. Your post is the equivalent of putting your hand up in class and answering "I don't know". If you don't have something meaningful to add, don't add anything.Quote from: BC_Programmer on September 09, 2008, 02:04:31 PM
    Quote from: garydeen on September 09, 2008, 06:21:13 AM
    I dont have idea about ur problem pls ask any computer experts about ur problem!!!!!!!!!!


    the problem was solved. Your post is the equivalent of putting your hand up in class and answering "I don't know". If you don't have something meaningful to add, don't add anything.

    It's like putting your hand up in class and answering "I don't know" after the answer has been given and eleven days later! lolQuote from: fireballs on September 09, 2008, 03:53:03 PM
    Quote from: BC_Programmer on September 09, 2008, 02:04:31 PM
    Quote from: garydeen on September 09, 2008, 06:21:13 AM
    I dont have idea about ur problem pls ask any computer experts about ur problem!!!!!!!!!!


    the problem was solved. Your post is the equivalent of putting your hand up in class and answering "I don't know". If you don't have something meaningful to add, don't add anything.

    It's like putting your hand up in class and answering "I don't know" after the answer has been given and eleven days later! lol

    not something people would consider behaviour of a BRIGHT student... Is this the same fellow that made a similar post in the batch programs thread?Quote from: BC_Programmer on September 09, 2008, 09:44:21 PM
    Quote from: fireballs on September 09, 2008, 03:53:03 PM
    Quote from: BC_Programmer on September 09, 2008, 02:04:31 PM
    Quote from: garydeen on September 09, 2008, 06:21:13 AM
    I dont have idea about ur problem pls ask any computer experts about ur problem!!!!!!!!!!


    the problem was solved. Your post is the equivalent of putting your hand up in class and answering "I don't know". If you don't have something meaningful to add, don't add anything.

    It's like putting your hand up in class and answering "I don't know" after the answer has been given and eleven days later! lol

    not something people would consider behaviour of a bright student... Is this the same fellow that made a similar post in the batch programs thread?

    Who knows and who cares....
    783.

    Solve : Command line with Flash??

    Answer»

    I am VENTURING into the unknown - hoping to broaden my horizons (and through necessity!)

    I currently have a utility that RUNS a number of internet security applications (which is currently done through COMMAND line switches) with a flash front end. Norton, Adaware, CCleaner & MSConfig (licenses were acquired where necessary - It's a home service my company sells)
    So basically the flash file is run, and the flash shell has buttons that run the various applications in the background. It uses batch files to call up the applications.

    Now I didn't create any of this - the guy that did is leaving the company, and I'm charged with continuing his work (yeh, lucky me!!).

    Is it possible to:

    a) automate the whole process - so you click one button and it runs all of the applications in turn
    and/or
    b) combine the whole thing into flash so it's one SINGLE package - currently it uses the flash FSCommand so all of the applications and batch files can be read by end users.

    Now, I'm not looking for someone to write me up a script, guide or any such thing - all I need is advice on what I should use to complete this process.
    Do I need to learn C++, Java or what?!!

    I have a basic working knowledge with Flash and some minor ActionScript knowledge - but that's it in terms of scripting and programming.


    Looks like NOBODY wants o say anything.
    Ok, here is a quote:
    Adobe Flash (previously called Shockwave Flash and Macromedia Flash) is a set of multimedia software created by Macromedia and currently developed and distributed by Adobe Systems.
    ...
    It contains a scripting language called ActionScript. ..

    So it would seem that you need to study ActionScript. Here is just one of many inks about this on the Web.
    http://www.adobe.com/devnet/actionscript/
    Hope this is of a some help.

    784.

    Solve : allowing two distant users to use one program?

    Answer»

    Hello
    I have created a program that allows users to compete for some prize I wish to allow two users to be able to run one program these users must run must work in groups and will be using different computers. the problem is that i dn't klnow how to get them both to play or compete over the same file simultaniusly by using the INTERNET

    I see you are a fellow rookie, so I will GIVE your the rookie answer.
    There is a thing in Windows XP called "remote assistance" that lets two PEOPLE work on one computer with one person being far away on another computer that acts like a remote terminal. I have done this and it is real cool. The two people can send each other messages and get the same view on the desktop. The can even both use keyboards inside of any normal windows program. This is mostly used for giving help to someone.
    And there are more involved things, like interactive gaming over the web. That is a special PROTOCOL that makes a Virtual Private Network between two users. But that is way above the rookie stuff. You might go into the gaming area and ask somebody there.

    785.

    Solve : Visual Studio Command Prompt error?

    Answer»

    I entered a program in Visual Studio C++, then I saved it in the default DIRECTORY as Sample.cpp.

    The default directory it was saved into was:

    C:\Documents and Settings\User\My Documents\Visual Studio 2005\Projects

    I went into the Visual Studio Command Prompt and TRIED to compile it. The following happened:



    If I move Sample.cpp to C:\Program Files\Microsoft Visual Studio 8\VC without putting it any sub-directories, just leaving it in that folder, then it compiles fine. But I don't want to have to keep all my .cpp files, my .exe files and my .obj files in that folder, it is really inconvenient.

    Does anybody know a way to change it so I can compile my .cpp files from anywhere to anywhere I like?The compiler likely needs a path pointer to your source file.

    Code: [Select]cl /EHsc "C:\Documents and Settings\User\My Documents\Visual Studio 2005\Projects\Sample.cpp"

    Any reason you're using the command line and not the IDE?


    Yes. I don't know how to compile with the IDE. LOL I dont have idea about your problem pleas ask any computer experts about your problem!!!!!!!!!!!
    _huhu-Quote from: garydeen on September 09, 2008, 06:12:50 AM

    I dont have idea about your problem pleas ask any computer experts about your problem!!!!!!!!!!!
    _huhu-

    garydeen, please do not make posts like that in future.I personally have Visual Studio 2008, but assuming they are the same, under the Build menu should be Build SOLUTION and Build 'Project Name.' Under the Debug menu, there should be 'Start Debugging.' Personally I just click Start Debugging, because it builds the project and at the same time lets me test out any new features I added/changes I made. I would think using the IDE to compile a program would be easier than using the command prompt...

    In addition, I believe there's an option when you first make a project, called "Create Directory For Solution." If this box is checked, it should make a directory only for that project, and Visual Studio should always refer to that directory to compile it.

    Like I said, I'm basing this from Visual Studio 2008, and despite how similar 2008 and 2005 are, there may be differences.

    ~ BaRR
    786.

    Solve : 'find and replace' code?

    Answer» HELLO! I'm using Fortran for the first time and I need to write a program which find all ',' in a TEXT file and replace them with ' '. I can't do it just using 'replace' in 'edit' because I need to produce an .exe file in order to automate its execution.
    Thanks a lot in advance! Fortran has a replace function you can use. Once again Google has all the messy details.

    Code: [Select]REPLACE(string,target,substring,every,back)

    Quote
    the COPY of string is searched for occurrences of target. The search is done in the backward direction if the argument back is present with the value true, and in the forward direction OTHERWISE. If target is found, it is replaced by substring. If every is present with the value true, the search and replace is continued from the character following target in the search direction specified until all occurrences of target in the copy string are replaced; otherwise only the first occurrence of target is replaced.
    Source

    This should work:

    var = replace(string, ',', ' ', True)

    Couldn't tell if the replacement is a space or a null. Fix if necessary.

    787.

    Solve : Big problem with DEEEP FREEZ?

    Answer» THANKS ,... I need to uninstall the DEEP FREEZ ,.... its DRIVING me CRAZY, but I dont known how to do it ....this pc has win xp as s/o ....could you help me ?....GOD BLESS you Number nine here..

    Edit: Also have a look at the SITE linked by Patio here.

    788.

    Solve : accessing data randomly from a file?

    Answer»

    IF anyone nows a function that I can use to ALLOW the user to access SENTENCES randomly from a file could he or she please tell meWhat language? Quote from: kpac on September 12, 2008, 02:40:41 AM

    What language?
    g++ (c++ but on a linux machine)k so I can have my paragraphs numbered and then use the randomize function but now the difficult part is making sure that what ever value or question was randomized the same value is checked if the inputted ANSWER is correct and the score is decremeanted or incrweamented depeanding on the GIVEN answer.

    thanx for looking at my post and for helping
    789.

    Solve : C++ - Problem with File I/O?

    Answer»

    Hi all.

    Please take a look at this code:

    Code: [Select]int main(int argc, char *argv[])
    {
    //reads an ASCII file containing a list of numbers and writes a binary file containing the same list.

    string buffer;
    ifstream input_file, bin_input_file;
    ofstream output_file, bin_output_file;
    input_file.open("Textdoc.txt");
    output_file.open("copied.bin", ios::out | ios::binary);

    GETLINE(input_file, buffer, '\0'); //ASCII file read into buffer



    char buffer_array[buffer.length()], buffer_array_2[buffer.length()]; //Create an array big enough to store content of buffer

    cout << buffer_array << endl << endl;

    system("PAUSE");
    return EXIT_SUCCESS;
    }
    The content of Textdoc.txt is: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 24 27 30 33 36 39 40 41 42 43 44 45 46 47 48 49 50 60

    The last line, cout << buffer_array << endl << endl; prints the following to the screen: 20 21 24 27 30 33 36 39 40 41 42 43 44 45 46 47 48 49 50 60 P3"

    Questions:
    1 - How come PART of the content of buffer is automatically copied into buffer_array without an explicit command for the program to do so?

    2 - Assuming for some reason, that it is supposed to copy the content of buffer automatically into buffer_array, why does it start at 20? Why doesn't it copy the entire content of buffer?

    I'd be extremely grateful for any help whatsoever in understanding this seemingly strange behaviour . Thanks.

    790.

    Solve : Customer?

    Answer»

    Customer
    Top
    The Customer page consist of the login details, where the customer has to enter their username and password to login, and requesting for the net banking and requesting for the password that the user has forgot.
    The page also CONTAIN's request status to check about the status of the user request.

    Input TYPE Object Name/setName Validation
    Enter the User Name JTextField cust_username Not Null
    Enter the Password JPasswordField cust_password Not Null
    Click Login JButton submit

    New NetBanking JButton netbanking_requestform
    Forgot Password JButton request_forgotpassword
    Request Status JButton request_status

    Once the user clicks the login, it has to verify whether the username and password value's are present if so it will check in the database that the username and password matches by using the function "new NetBankingLogin().checkLogin(con, username, password)". If the function return true than it has to redirect to the UserHome by setting the username in static variable. else the page has to redirect to the "Customer" by updating the table "login_history" by using the function "new NetBankingLogin().loginHistory(con,username,datetime)" the datetime can be get by using the function "new Utilities().getCurrentDateAndTime()".
    Example Input
    --------------------------------------------------------------------------------
    Enter the username user
    Enter the password ****




    Output
    --------------------------------------------------------------------------------

    After successfull login it will redirect to the "UserHome" by setting the username as static in some variable.
    On click New NetBanking button it has to redirect to the "NetBankingRequestForm"
    On click Forgot Password button it has to redirect to the "RequestForgotPassword"
    On click Request Status button it has to redirect to the "RequestStat





    but PROBLEM is that how to make plz help










    Quote from: khushi

    problem is that how to make plz help

    Just a SIMPLE problem...

    You clearly do not understand how to do your homework. Tell your tutor.

    [Edit]

    1. Get great muscles
    2. Get HOT chick
    3. Make $1,000,000
    4. Win Nobel Prize

    Problem is how to do, plz help...


    791.

    Solve : Admin CMD?

    Answer»

    how would i reverse or make a .REG to delete these ENTRIES:
    Code: [Select]Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\Directory\shell\runas]
    @="ADMINISTRATOR Command Prompt here"
    "NoWorkingDirectory"=""

    [HKEY_CLASSES_ROOT\Directory\shell\runas\command]
    @="cmd.exe /K \"pushd %L && TITLE Command Prompt\""

    [HKEY_CLASSES_ROOT\Drive\shell\runas]
    @="Administrator Command Prompt here"
    "NoWorkingDirectory"=""

    [HKEY_CLASSES_ROOT\Drive\shell\runas\command]
    @="cmd.exe /k \"pushd %L && title Command Prompt\""

    792.

    Solve : appending a multiline textbox in VB???

    Answer»

    basically i need the code for this situation

    i have something in line 1, 2, 3, and so on and i need to add something to the next line, whatever it might be. I've looked around and all I can find is skipping lines with the same command. What I WANT is with each new event I want it to input the event description into my TEXT box.okay well never mind on the last part because i got it but now I need to have it scroll to the last line in the textbox when a line is added.Quote from: gamerx365 on September 18, 2008, 04:51:19 PM

    okay well never mind on the last part because i got it but now I need to have it scroll to the last line in the textbox when a line is added.

    now that i think about it I'll add details:

    Using VB Express 2005

    and my current code for adding text is:
    Code: [Select]advconsole.Text = advconsole.Text & vbCrLf & "Advanced CONSOLE disabled"
    This is with VB.NET in Visual Studio 2005

    Code: [Select]RichTextBox.AppendText(vbCrLf & "This is a test")
    RichTextBox.ScrollToCaret()

    If you USE AppendText() you don't need to grab the current text in the box. ScrollToCaret() moves to the current position of the caret which, immediately after appending text, is at the bottom.dude thank you. LOLZ. of course i had like 30 lines of code that I had to go back and edit but thank you lolz.
    793.

    Solve : VBScript to download Exchange attachments?

    Answer»

    I am working on some code to download one users email and drop them into a folder. I would like to run on the exchange server so I have been using EXOLEDB. Here is what I have thus far:

    For Connection
    Code: [Select]Set WshShell = CreateObject("Wscript.Shell")
    inboxURL = "http://server/Exchange/vzorders/inbox/testinbox" 'Mailbox Location
    parsedURL = "http://server/Exchange/vzorders/Inbox/testmove/" 'Archive Location
    dlFile = "\\server2\c$\testsave" 'Save File
    strUserName = "user" 'Admin Username
    strPassword = "password" 'Admin Password

    Dim oConn
    Set oConn = WScript.CreateObject("ADODB.Connection")

    oConn.Provider = "ExOLEDB.DataSource"
    oConn.Open = inboxURL
    To try to download the attachment
    Code: [Select]for each Item in colItems
    ' read each item in the folder
    WScript.Echo "Reading " & Item.Subject
    ' Not needed, but good to see what is going on.
    WScript.Echo " Attachments: " & Item.Attachments.Count
    Set Attachments = Item.Attachments
    if Attachments.Count > 0 then
    ' Add a statement about removing the file here
    Item.HTMLBody = Item.HTMLBody & vbVr & _
    "<p> <p>" ' TODO: Add a statement about moving the files
    Item.Save
    end if

    Dim AttachmentsCount
    AttachmentsCount=Attachments.Count
    for index = AttachmentsCount To 1 Step -1
    Set Attachment = Attachments(index)
    WScript.Echo " Saving " & Attachment.FileName
    ' Again not needed, just to see what is going on.
    Dim SaveName
    'Dim TmpName 'Uncomment all Tmpname reference to add extension in front of name
    Dim Name
    'TmpName = FSO.GetTempName
    ' This helps avoid clobering files with the same name
    ' but really there should be a filesystemobject check to be 100% sure.
    Name = Attachment.FileName 'TmpName & "__" & Attachment.FileName
    SaveName = SaveFolder & Name
    Attachment.SaveAsFile SaveName

    ' Uncomment the following if you would like to download and create a link to the attachment
    ' Attachment.Delete
    ' Dim Body
    ' Body = Item.HTMLBody & vbVr & "<a href='"&SaveName&"'>" & SaveName & "</a><br>"
    ' Item.HTMLBody=Body
    ' Item.Save

    ' If you want to simply delete the attachments you can axe the SaveAsFile
    ' and all the changes made to the Body.HTMLBody
    On Error Resume Next
    next


    On Error Resume Next
    nextThe two sections are compiled snippets I found and I might be going about this completely wrong, any advice would be great.Not familiar with the ExOLEDB provider, but this looks like something I did to grab attachments from Outlook emails.

    There is nothing destructive in the code. Have you tried running it? Any error MESSAGES? It's easier to debug something once we have a clue what it is doing versus what you want it to do.

    To start on line 14, (for each Item in colItems) I get "Object is not a COLLECTION".I should have NOTICED this the first time. The script shows a ADO connection. Seems reasonable you'll need an ADO recordset and a SQL Select statement.

    Code: [Select] strSql = "";
    strSql = "select ";
    strSql = strSql & " \"urn:schemas:mailheader:content-class\"";
    strSql = strSql & ", \"DAV:href\" ";
    strSql = strSql & ", \"DAV:displayname\"";
    strSql = strSql & " from scope ('shallow traversal of " + "\"";
    strSql = strSql & sFdUrl + "\"') ";
    strSql = strSql & " WHERE \"DAV:ishidden\" = false";
    strSql = strSql & " AND \"DAV:isfolder\" = false";

    As mentioned, I'm not familiar with Exchange or it's notation.

    Microsoft Eample

    Note: the example is C++; the SQL is the same (replace + with &)

    Good luck. I noticed in the example they defined a recordset and some fields as well, is that something I need to try?I would think so. Once the data is in the recordset, you'll need to make changes to any FIELD names in the download attachment section:

    Code: [Select]Set WshShell = CreateObject("Wscript.Shell")
    inboxURL = "http://server/Exchange/vzorders/inbox/testinbox" 'Mailbox Location
    parsedURL = "http://server/Exchange/vzorders/Inbox/testmove/" 'Archive Location
    dlFile = "\\server2\c$\testsave" 'Save File
    strUserName = "user" 'Admin Username
    strPassword = "password" 'Admin Password

    Dim oConn
    Set oConn = WScript.CreateObject("ADODB.Connection")
    set oRS = WScript.CreateObject("ADODB.Recordset") 'added record set

    oConn.Provider = "ExOLEDB.DataSource"
    oConn.Open = inboxURL

    strSql = "";
    strSql = "select ";
    strSql = strSql & " \"urn:schemas:mailheader:content-class\"";
    strSql = strSql & ", \"DAV:href\" ";
    strSql = strSql & ", \"DAV:displayname\"";
    strSql = strSql & " from scope ('shallow traversal of " + "\"";
    strSql = strSql & sFdUrl + "\"') ";
    strSql = strSql & " WHERE \"DAV:ishidden\" = false";
    strSql = strSql & " AND \"DAV:isfolder\" = false";
    oRS.Open strSQL, adoCon, 2

    oRS.MoveFirst
    do until not oRS.EOF
    wscript.echo oRS.item(0), oRS.item(1) oRS.item(2)
    oRS.MoveNext
    loop

    You'll need to fixup the SQL statements. When done use cscript to test. I added
    that last loop to print the recordset. Might be wise to see what we're dealing with before proceeding.

    794.

    Solve : \WINDOWS\Internet Logs\tvDebug.log?

    Answer»

    Can anyone tell me what the H**l this is and how can I turn it off ?? THANKS JERRY XP Pro OPcan you tell us what the heck MAKES you WANT to get RID of it and how you turn off a file?This is Zone ALARM log.
    It'll grow pretty big over time.
    How to empty it: http://forum.piriform.com/lofiversion/index.php/t1596.html

    795.

    Solve : VBScript - Read text file & Decide Process from Results?

    Answer»

    Hi All,

    I am using vbscript to find what out what the operating system is, and creating a text file with the results - by way of the OS version (i.e. XP is 5.1, Vista is 6.0.00).

    What I'd like to do is then decide which disc cleanup commands to use from these results, through another VBScript file. I can get the script to read from the text file, but I can't it to WORK if I add "If and Else" arguments on the OS version detail it finds.

    I'm trying to get it to read the file and if it reads "5.1 then do this" - else "if it reads 6.0 do that"

    My code thus far is:

    Const ForReading = 1

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.OpenTextFile("..\whatisos.txt", ForReading)

    strLine = objFile.ReadLine
    If strLine = "5.1" Then

    dim SHELL
    set shell=createobject("wscript.shell")
    shell.run "cleanupxp.bat"
    set shell=nothing

    Else

    dim shell
    set shell=createobject("wscript.shell")
    shell.run "cleanupvista.bat"
    set shell=nothing

    End If

    objFile.Close


    Any help is greatly appreciated.
    your Dim-ing Shell twice. remove the Second Dim Shell Line.


    what errors do you get?none now you absolute genius!! LOL nice PRAISE... Quote from: pcwizard on September 23, 2008, 01:44:44 PM

    none now you absolute genius!!
    Good! One way to make SURE you don't accidentally Dimension a variable twice is to declare them all first, IE, with your constants.

    I get burnt a lot myself when I try to Dimension them right when I need them, but I'm spoiled because I'm using VB6 rather then VBScript, which means I actually get an IDE.
    796.

    Solve : please suggest any project on embedded system?

    Answer»

    hi friends,

    there is major PROJECT in front to be made during this semester. I wanna make a project on embedded system that make use of C as programming language. it should neither be so VAST which require higher expenses nor it should be so little that wouldn't make any impression on anyone.

    actually I have to give project title tomorrow, is there any project you can suggest for?

    Sorry, but we can't help with homework. Well, he's not asking for us to DO his homework, he's asking for ideas. And I don't SEE anything wrong with that. Unfortunately, I'm not familiar with embedded systems, so I don't know if I can just give any general tips on something to do or not.Tell us more about this embedded system in which you plan to WORK.

    To me, an example of an embedded system is the hardware / software which makes a photocopier RUN, or a coffee maker with a digital timer.

    797.

    Solve : VBScript - Subtract one text file value from another?

    Answer»

    Only me!

    I've just moved the bed in as I can see this being my second home now!

    I have 2 text files with one numerical value each (i.e. 54338). I would like to get another script to take one value and subtract it from the other, and have this resultant value written to a new (3rd) text file.

    what I have is:

    Const ForReading = 1

    strComputer = "."

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile1 = objFSO.OpenTextFile("..\freespacebefore.txt", ForReading)
    objFile1.Close

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile2 = objFSO.OpenTextFile("..\freespaceafter.txt", ForReading)
    objFile2.Close

    Set objFile3 = objFSO.CreateTextFile("..\savedspace.txt")
    objFile3.WriteLine "savedspace=" & (objFile2-objFile1)
    objFile3.Close


    The error message I am getting is 'Object doesn't support this property or method' - refering to the highlighted text.Opening a file does not get you any data. You'll need to read the file.

    Code: [Select]Const ForReading = 1

    strComputer = "."

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile1 = objFSO.OpenTextFile("..\freespacebefore.txt", ForReading)
    value1 = objFile1.ReadLine
    objFile1.Close

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile2 = objFSO.OpenTextFile("..\freespaceafter.txt", ForReading)
    value2 = objFile2.ReadLine
    objFile2.Close

    Set objFile3 = objFSO.CreateTextFile("..\savedspace.txt")
    objFile3.WriteLine "savedspace=" & (value2 - value1)
    objFile3.Close

    Thank you for your speedy response, much appreciated.

    I am getting an error message from the code:

    Type mismatch: 'value2'Quote

    I have 2 text files with one numerical value each (i.e. 54338). I would like to get another script to take one value and subtract it from the other,

    Probably need to parse the data.

    Code: [Select]Const ForReading = 1

    strComputer = "."

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile1 = objFSO.OpenTextFile("..\freespacebefore.txt", ForReading)
    arrData1 = Split(objFile1.ReadLine, " ")
    objFile1.Close

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile2 = objFSO.OpenTextFile("..\freespaceafter.txt", ForReading)
    arrData2 = Split(objFile2.ReadLine, " ")
    objFile2.Close

    Set objFile3 = objFSO.CreateTextFile("..\savedspace.txt")
    objFile3.WriteLine "savedspace=" & (arrData2(0) - arrData1(0))
    objFile3.Close

    Based on each numerical value followed by a space.



    Curious: What is strComputer?Sidewinder, would Val() not perform the same function as your usage of Split()?It might have, but val() is not listed as a valid function in the VBSCRIPT documentation! Using the val function throws a type mismatch error.

    VBScript Documentation



    I'm still getting a Type mismatch: 'arrData2(..)

    The strComputer"." - applies it to the local machine. Just something I have been doing as I''ve also worked on networked computers with vbscript.Quote from: Sidewinder on SEPTEMBER 24, 2008, 07:10:19 AM
    It might have, but val() is not listed as a valid function in the VBScript documentation!


    hmm, I guess VB6 wins this round

    I guess instead of having explicit conversion function, they decided to have VBScript always USE Evil Type coercion, since EVERYTHING is a Variant.



    Quote from: pcwizard on September 24, 2008, 07:16:02 AM
    I'm still getting a Type mismatch: 'arrData2(..)

    The strComputer"." - applies it to the local machine. Just something I have been doing as I''ve also worked on networked computers with vbscript.

    hmm, weird, it works for me.

    but whats with the use of .. for parent directory?PCWizard: Please post the data from the freespacebfore and freespaceafter files. I cannot duplicate your error.

    Quote

    I guess instead of having explicit conversion function, they decided to have VBScript always use Evil Type coercion, since everything is a Variant.

    VBScript was designed for non-programmers. With everything a variant (except date/time), there was no need for the user to get bogged down with data types and worrying about conversions. Let the interpreter do the work based on real live data!



    Let me clarify, VBScript does something that in Visual Basic is referred to as Evil Type coercion. In the context of a script language it makes sense and has a greatly reduced evilness, but it adds to the confusion when my Scripts constantly fail because of my insistence to automatically put a type. Or even worse, TRY to use objects from VB- like the PropertyBag and such.
    Or try to do both at once!

    Code: [Select]Dim PropBag as New PropertyBag
    Quote
    but whats with the use of .. for parent directory?

    I'm using Flash as a front end, so containing all of the code samples and scripts in the fscommand folder. But the text files remain outside of this because the content is being accessed by flash again afterwards.Quote from: Sidewinder on September 24, 2008, 07:35:33 AM
    PCWizard: Please post the data from the freespacebfore and freespaceafter files. I cannot duplicate your error.

    Quote

    following your request I have found the issue is indeed with the content from the 2 text files.

    I have freespace after as "freespaceafter=123456"
    I have freespacebefore as "freespacebefore=1234567"

    I see now that the variables freespace..... are causing the issue.

    I need these to remain though as this is what flash uses to collect the data. I should however be able to get vbscript to create duplicate freepsace... files without this text in.

    Thanks so much for everyone's help.
    Not sure if you found the solution, but this might help:

    Code: [Select]Const ForReading = 1

    strComputer = "."

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile1 = objFSO.OpenTextFile("..\freespacebefore.txt", ForReading)
    arrData1 = Split(objFile1.ReadLine, "=")
    objFile1.Close

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile2 = objFSO.OpenTextFile("..\freespaceafter.txt", ForReading)
    arrData2 = Split(objFile2.ReadLine, "=")
    objFile2.Close

    Set objFile3 = objFSO.CreateTextFile("..\savedspace.txt")
    objFile3.WriteLine "savedspace=" & (arrData2(1) - arrData1(1))
    objFile3.Close

    Happy coding.
    798.

    Solve : Saving information in Qbasic?

    Answer»

    Hello

    I am looking for a more convenient way to save information in Qbasic.

    Right now, I am using the following method:

    Code: [Select]open "pdata.dat" for random as #1
    print "Type the data you would like to save"
    input data$
    put #1, 1, data$
    cls
    print "Type the next data you would like to save"
    input data2$
    put #1, 2, data2$
    close #1
    end (thats only an example)

    My problem is this:
    The library system (put #1, 22, value$ ) is terrible inconvenient, and very hard to keep track of.

    How can I make it so that its all saved without having to keep track of the numbers?


    (I know, its Qbasic, and its getting more and more uncommon, but hey, its still compatible with Vista!)
    I am using the full Qbasic COMPILER program, not the limited version Ah, good old QBasic!

    You are saving a string, why are you using open file for random? Why don't you just do this? Why the CLS? (You can't see what you typed before) Why don't you use LINE INPUT for the strings? (INPUT won't let you include a comma in the string)

    Code: [Select]open "pdata.dat" for output as #1
    print "Type the data you would like to save"
    input data$
    print #1, data$
    cls
    print "Type the next data you would like to save"
    input data2$
    print #1, data2$
    close #1
    end

    Why not do it in a loop? (Then you can type more than 2 strings)

    Code: [Select]open "pdata.dat" for output as #1
    do
    print "Type data to save (ENTER to quit) ";
    line input data$
    if data$="" then exit do
    print #1, data$
    loop
    close #1
    endQuote from: contrex on June 28, 2007, 02:36:33 AM

    Ah, good old QBasic!

    You are saving a string, why are you using open file for random? Why don't you just do this? Why the CLS? (You can't see what you typed before) Why don't you use LINE INPUT for the strings? (INPUT won't let you include a comma in the string)
    I am using the Random statement so that I can both save, and open the file. I understand that I can save information using the OUTPUT statement, but I cannot retrieve it. (Well, not without closing the file, opening it again)
    The code I posted was just an example, thus, the CLS and whatever else is pointless
    Quote
    <snip>

    Why not do it in a loop? (Then you can type more than 2 strings)

    Code: [Select]open "pdata.dat" for output as #1
    do
    print "Type data to save (ENTER to quit) ";
    line input data$
    if data$="" then exit do
    print #1, data$
    loop
    close #1
    end
    I don't understand how loops work, to tell you the truth, I messed around with them once, but really didn't get it at all.

    So I will need to be able to PUT the information, and GET it as well.
    If you don't like having "magic numbers" in your code, and I don't blame you, (it is bad practice) you can use numeric variables and increment them each time.

    Code: [Select]open "pdata.dat" for random as #1
    n=1
    print "Type the data you would like to save"
    input data$
    put #1, n, data$ : n=n+1
    cls
    print "Type the next data you would like to save"
    input data2$
    put #1, n, data2$ : n=n+1
    close #1
    end

    You should try with loops. they not complicated. Things just got round and round until it's time to stop.
    I will GIVE that a try

    The Qbasic library system is terrible, I just hope more than ever that this will work out

    How well will it function with Subs if they were to go out of order?

    And would this be correct to retrieve the data again:

    Code: [Select]open "pdata.dat" for random as #1
    n=w
    print "Type your info"
    input data2$
    put #1, n, data2$ : n=n+1
    cls
    get #1, n, data2$ : n=n+1
    close #1
    Quote from: Zylstra on June 28, 2007, 03:53:29 PM
    And would this be correct to retrieve the data again:

    Quote
    open "pdata.dat" for random as #1
    n=w
    print "Type your info"
    input data2$
    put #1, n, data2$ : n=n+1
    cls
    get #1, n, data2$ : n=n+1
    close #1

    No, because what you are doing is

    1. Ask the user to type a string
    2. PUT that string to record number N
    3. Increase the value of N by 1
    4. GET record number N

    So you will GET the next record after the ONE that you wrote, which may not even exist YET, and is certainly not the one that you want.

    Hint: Run your code to see if it works! If you had put a "PRINT data2$" at the end of that code, you could have tested it.

    Why are you doing all this QBasic stuff?


    I'll try it out

    I like to program in Qbasic for no reason at all, but sometimes I make something for myself, I was trying to write a registry-type system that could be intergraded into my programs but I ran into a problem that can be fixed with your suggestion.

    Also, I use it for resuming sessions in my random programs (thus why I have to use GET and PUT at the same time)

    799.

    Solve : More batch lies?

    Answer»

    This is my problem:

    I need a batch file to delete a *.pif file created by a game every time i run it...
    (Im running Win XP Professional edition)
    So i put it like this in the batch im trying to CREATE:

    del C:\Programs\bla bla\bla\blabla\blablabla\*.pif /P
    pause

    (that's not really the path )
    And it gives me a "path not found" in the prompt
    I've tried all sorts of variations i've even tried without using wild cards, with other files elsewhere on my c: drive, setting the file attribute and all but... helas... no GO
    What am i doing wrong here?
    If you could plz give you insight on this sorry bout that
    nasty typo: not lies files What if you used explore or search to find the exact location of the file then copy/paste that location in your batch eliminating any typos etc?i've had issues with batch files and long file names. for example:

    c:\documents and settings\user files\favs

    would be

    c:\docume~1\userfil~1\favs

    in your batch file.

    You best bet is to TYPE:

    command

    from the run line (you cannot use the cmd shortform as this shell allows long file names) and trace your path from the command promptuse "path"Quote

    This is my problem:

    I need a batch file to delete a *.pif file created by a game every time i run it...
    (Im running Win XP Professional edition)
    So i put it like this in the batch im trying to create:

    del C:\Programs\bla bla\bla\blabla\blablabla\*.pif /P
    pause

    (that's not really the path )
    And it gives me a "path not found" in the prompt
    I've tried all sorts of variations i've even tried without using wild cards, with other files elsewhere on my c: drive, setting the file attribute and all but... helas... no go
    What am i doing wrong here?
    If you could plz give you insight on this

    @noka: ?put the path in quotes.

    del "c:\program files\microsoft office\*.pif"
    pauseBrainiacOutcast, we UNDERSTAND that everybody needs to get their post count up, but reviving 3-year-old threads is a bit obvious! Or don't you bother reading the DATES?

    800.

    Solve : a batch file to replace words in text files?

    Answer» HI, everyone.
    is there a command that I can use in Command Prompt to replace once WORD or STRING for another in a text file?
    or is there a way to do it without actually opening the file manualy with notepad.exe or something and replacing it there? thank you!BrainiacOutcast, you're getting a bit silly reviving ANOTHER THREE year old thread, and GIVING a wrong answer into the bargain!

    check out "sed for Windows".