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.

301.

Solve : Auto lock, unlock and shutdown using VB script?

Answer»

Hi Experts,

When we want to lock the computer we do the following:
Ctrl Alt Del
(A dialog box appears)
Lock computer

When we want to unlock the computer we do the following:
Ctrl Alt Del
(A dialog box appears)
Key in password
Enter

Using VB script in XP Professional is it possible to:
1.      automate the above,
2.      automate a shutdown at specified time?

Thanks.
1) I would not recommending scripting the entry of user passwords, this will create large security holes. PERHAPS if you could explain a bit more of the purpose there might be a better work around.

2) To shutdown XP I would simply use the built in Shutdown.exe program.

Type shutdown -? to get a LIST of options.

You should be able to force the shutdown of a locked MACHINE if the running scripts has the correct privledges (IE: admin)

The intend is to start up the pc to run some programs,
upon completion force shutdoown the pc.

Thanks.
How do you intend to start the system in the first place?Thinking of using the BIOS to setup the Pc on certain days/time.

Thanks.Does your BIOS cater for this?You can setup Windows to automatically login on startup that would take care of the login without the need for CTRL-ALT-DELETE, so long as you are okay with this.

I imagine the shutdown command should work regardless of whether or not the workstation is locked.

As for the auto-startup, if BIOS doesn't support it you could hard wire it in such a way such that by plugging   in the PC turns it on, and then hook the plug up to a timer.

I had a machine setup like this before, but it was pretty hard on the power supply, it was easier to just leave it on all the time.

302.

Solve : Batch Scripting/Creating a Logon Script?

Answer»

I'm fairly NEW to batch scripting, and
I've seen Batch File logon scripts that run IMMEDIATELY after a user logs on to his/her ACCOUNT. I know these scripts can be used to connect to network drives and such like below...

Code: [Select]net use R: \\officeserver\shared
net use P: \\officeserver\appsand my question is how do they get this file to run immediately after logon?  For a single workstation, try putting the login script in the "c:\documents and setttings\all users\start menu\programs\startup" folder. The script will run no matter who signs on.

On a domain network, the script runs from the server. The network administrator needs to set this up.

Hope this helps. 8-)   Thanks, this was exactly what I was LOOKING for.

303.

Solve : Eclipse won't compile?

Answer»

When I try to compile, I GET this screen. No matter what I try, the "Run" BUTTON STAYS grayed out. HEEELP! I am TIRED of BlueJ!

304.

Solve : audio converter in vc++?

Answer»

im making an AUDIO converter (mp3, wav, wmv.. all to all) using vc++. any suggestions for a good algorithm and where i COULD FIND it??
any other suggestions are also welcome.. tips and guidelines as to how i should go about it..[highlight]SourceForge[/highlight] WOULD be a good place to start.

305.

Solve : Find list of all the server and DB names using C#.?

Answer»

:-?

Hi

I NEED to FIND the LIST of all the servers and the database names in SQL Server but using C#.net.

I am writing an APPLICATION using C#.Net. I need to find all the servers and DB's so that I could add them to a list box to be selected.

The names of servers and databases should be in Enterprise Manager. But I need a piece of code in C# to list all of them. I will than TAKE them and add them to a combo box in the interface.

Please Help

306.

Solve : Isolating Integers From Characters in C language?

Answer»

Hi there people!
I'm TRYING to write a function in C language that reads from the user a set of integers separated by ',' (commas), but I'm having difficulty isolating the integers from the characters. I'm not sure if I should do it using a "for" or "while" loop,...
So if the input is something like: {100,20,50}
then, I should be ABLE to store the integers 100 20 50

Anybody got any idea how to do that??
I would really appreciate the help!!
Thanks.Check out the split function which RETURNS a zero-based, one-dimensional array containing a specified number of substrings.

Good luck.  8-)

307.

Solve : Adding a Copy function with C#.Net - Help?

Answer»

:-? :-?

Hi

I need to add code in C#.Net that allows a USER to RIGHT click and select the COPY FUNCTION. This would allow the user to copy information to the clipboard and paste elsewhere.

SOS
HELPFor text, use the SetText method:

Clipboard.SetText(data, dataformat)

To retrieve the clipboard data, use the GetText method:

Clipboard.GetText(dataformat)

Note: there are other formats besides text (images, audio, etc). Match the method (Get/SetImage, Get/SetAudioStream, etc) to your data format.

Hope this helps.  8-)

Note: The C#.NET help index has much information on this and many other subjects.
This does not really help

I need a fuction that I can use from any where on the form.
That applies to a single object such as a textbox or image, etc.

I need something more generic. The same piece of code should work on any object not just a particular object.

Is this possible???
HelpI would think you could QUERY the dataformat of the object and handle it with the appropriate code. Not familiar with C# but in VB this would be the way to go. Pass the object and the dataformat to the function and set up the set/get commands as needed.

Good luck.  8-)

308.

Solve : combining text and output into 1 logfile?

Answer»

For creating a log file i have to combine text and the result of the copy command in 1 text line in a new file.

now:
echo %varname% >> LOGFILE
copy x Y >> logfile

this result in two lines in the logfile
varname
1 files copied


is it possible to connect it to get the following result:

varname ; 1 files copied

1 line in the logfileMost versions of DOS do not have an echo command that will supress newline. This means that any echo command will automatically move to the next line.

You can create your own version of echo that supresses newline with the following command

ECHO ,8P_,FPZ0U]0U[,B0EWP_[[email protected][email protected]O!A>%TEMP%.\echoit.com

This creates a quick assembly file called echoit.com in your %temp% directory.

Then change your commands that USE echo command to use echoit instead. So something like

ECHO OFF
ECHO ,8P_,FPZ0U]0U[,B0EWP_[[email protected][email protected]O!A>%temp%.\echoit.com
%temp%\echoit %varname% ;>> logfile
copy x Y >> logfile
del %temp%.\echoit.com ;DELETE the program when we are done with it.

You don't have to create and delete the file each time. You could just make it once but then your batch would be specific to the one machine that has echoit.com on it.
Thanks, it works fine

309.

Solve : How do I make a program that can activate keys??

Answer»

Hi,

I need a program that activates the key "q" releases it and then activates key "e".
I also need a start key "k" and "k" to stop it again.

How do i make that program?
I don't now anything about PROGRAMMING, but I hope that someone can help me.

Sorry for my bad english.

Regards,
ColzenYou MEAN like a PLAYER PIANO?  

You can probably mimic this LOGICALLY (physically you're on your own).  Which language were you planning to use?

Need more info.

 :-?
Rather than re-invent the wheel, why not download the source code for >AutoHotKey< which does this plus much more?Didn't know that program, but it did it  
I do have a little trouble though. It's not easy to stop it again, the timing must be allmost perfect  :-/

310.

Solve : Log for files open?

Answer»

Hi experts,

Files with different datas are kept in a common subdirectory.

Would like to KNOW how many times a particular file have been open
and by dates. This information need to be saved in a log (text) file in another separate (not common) directory.

(The intention is to know which files is the most POPULAR. Using XP)
 
As a newbie, which scripting language is the best and which web site provides samples?

Thanks.

It's easy enough to WRITE a script that will monitor events resulting in a change to the file system. Opening a file for input (reading) does NOT produce an event that can be monitored. With a little imagination, you could log the events to a file and create a script to summarize the activity. (EXCEL?, perhaps)

This script will monitor file system events in the c:\windows\system32 directory:
Code: [Select]strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colMonitoredEvents = objWMIService.ExecNotificationQuery _
    ("SELECT * FROM __InstanceOperationEvent WITHIN 3 WHERE " _
        & "Targetinstance ISA 'CIM_Datafile' and " _
            & "TargetInstance.Drive = 'c:' And "_
             & "TargetInstance.Path= '\\windows\system32\\'")
Do
    Set objLatestEvent = colMonitoredEvents.NextEvent()
         'WScript.Echo objLatestEvent.Path_.Class & " " & objLatestEvent.TargetInstance.Name

    Select Case objLatestEvent.Path_.Class
      Case "__InstanceCreationEvent"
             WScript.Echo "File Created: " & objLatestEvent.TargetInstance.Name
      Case "__InstanceDeletionEvent"
             WScript.Echo "File Deleted: " & objLatestEvent.TargetInstance.Name
      Case "__InstanceModificationEvent"
            WScript.Echo "File Modified: " & objLatestEvent.TargetInstance.Name
    End Select
Loop

There are many free scripting languages. Choosing one is like wine. Choose the one you like. VBScript and JScript are installed free with every Windows version except Win95 (A & B).  They're easy to use and understand.

Perl, Python and PHP are popular but are geared to the internet. Can be run within Windows.

REXX comes from IBM mainframes (VM/CMS). Both versions (Classic & Object)  have been ported to Windows. (note: the REXX IDE is proprietary ($$$) but the interpreter is free).

The nice thing about script is they are not compiled and linked. Running under an interpreter, all you need is an editor (notepad works fine) to create a text file.

A good script site with plenty of VBScript examples is the Script Center

Good luck.  8-)

311.

Solve : Basic Batch Files?

Answer»

Hello,
I've started learning basic batch FILES, and was wondering how to open docuements (I.e 'My Documents') once the Batch FILE is opened...
Thank you
,SpedzDo you mean a batch file to open the My Documents folder? If so, all you need in the batch file is

Code: [Select]CD C:/Documents and Settings/[YOURNAME]/My Documents
assuming you are running Windows XP. I don't know the layout of the other OPERATING systems that well.

Please let me know if that's not what you want. I'll be HAPPY to help.  8-)Is  this code supposed to open a window on your desktop? For me, I get an error when I try to run that code. I put Quotes around it and I could get it to cd to the directory. Please explain how to open the window up. I am using notepad to MAKE the batch file.I am using XP Professional. Thanks for your help

You need to start the explorer.
Try this sentence:

explorer "C:/Documents and Settings/[YOURNAME]/My Documents"

312.

Solve : Inserting Icons into the program?

Answer»

ok so i've written an APP and i've created an icon for it, how MIGHT i GO about inserting the icon into the program?Many languages have a forms property SHEET where you can point to an icon during development. You can also RIGHT click the current icon for the program, choose properties, click change icon and point to the icon you wish to use.

Happy Computing.  8-)

313.

Solve : Does WIN XP support graphics of C++(dos mode) ??

Answer»

Hello,
I've the PROBLEM that when i run any graphics BASED program of C++ ,a blank screen appears, no result display.The file compiles successfully but no output GENERATED while other (Non graphics programs) are successfully compiled and output is generating.I've SVGA Card and EGAVGA files also in bgi directory but no graphics are displayed,although the correct path is mentioned in the file.
Thanks for your valueable timeXP Doesn't like to support DOS at all.

Try DOSBOX http://dosbox.sourceforge.net/news.php?show_news=1

It's free and MIGHT help.

314.

Solve : Program Icons.?

Answer»

Well I'm not much of a programer yet, but I can build some basic STUF. I also hapen to have some basic programs I made out of bat files to do quiker things on my comp like shuting it down, accesing Telnet, CMD......
What I'd like to know is if there is a way to change the icons f the programs into sumthing else than the WHITE WINDOW. I have de RESHACKER debuger and could modifiy the program the problem is I dont know what to modify T_T
thanksGoogle comes up with 23,200,000 possibles on searching for 'change icons'  Here is just one...

MAKE Google your friend...

315.

Solve : CMD project help?

Answer»

I have this batch file project for SCHOOL. In the beginning you are asked to fight or stay, then if fight armor or not. When you buy armor it takes you to the WRONG screen. Not the screen for buying armor. Plz help. Included is the file. Code: [Select]echo off
title Crusaders
::ll
:menu
color 84
cls
echo ________________________________________________________________________________
echo     CRUSADERS
echo --------------------------------------------------------------------------------
echo         Type "start" to begin the game.
echo        Type "commands" to view commands.
set /p test=.   Command:
cls
if %test%==commands goto :commands  (
) ELSE (
if %test%==credits goto :credits  (
) else (
if %test%==menu goto :menu  (
) else (
if %test%==exit goto :eof  (
) else (
if %test%==start goto :start (
) else (
if not %test%==start goto :menu  (
)
)
)
)
)
)
:commands
echo ________________________________________________________________________________
echo   COMMAND LIST
echo --------------------------------------------------------------------------------
echo            commands: Shows command list.
echo       menu: Back to main menu.
echo     credits: Shows credits.
echo       exit: Goes back to CMD.
set /p test=.            Command:
cls
if %test%==commands goto :commands  (
) else (
if %test%==credits goto :credits  (
) else (
if %test%==menu goto :menu  (
) else (
if %test%==exit goto :eof  (
) else (
if %test%==start goto :start (
) else (
if not %test%==start goto :menu  (
)
)
)
)
)
echo Invalid command.
)
cls
:credits
echo ________________________________________________________________________________
echo     CREDITS
echo --------------------------------------------------------------------------------
echo     Creators
echo                         Brad Walters
echo                         Aidan Taylor
set /p test=.   Command:
cls
if %test%==commands goto :commands  (
) else (
if %test%==credits goto :credits  (
) else (
if %test%==menu goto :menu  (
) else (
if %test%==exit goto :eof  (
) else (
if %test%==start goto :start (
) else (
if not %test%==start goto :menu  (
)
)
)
)
)
echo Invalid command.
)
:start
cls
echo ________________________________________________________________________________
echo    CRUSADERS
echo --------------------------------------------------------------------------------
set /p name=.           Enter your characters name:
echo Pope Urban II has been talking of WAR.
echo The people of Jerusalem have fallen to the Turkish.
echo The old people of Jerusalem where fairly kind to us,
echo even though our beliefs where not alike.
echo But the Turkish. They slaughtered many of our faith.
echo Both the old people of Jerusalem and the Turks where Islamic,
echo but the old people of Jerusalem accepted the fact we where christian.
echo Now, Pope Urban is reaching out to the people,
echo requesting that we help him take Jerusalem from the Turks.
echo He claims that if we are to help him in the war and die while doing so,
echo we are granted immediate access to heaven.
echo So %name%. You are now with a choice.
echo 1. Join Pope Urban in the war against the Turks.
echo 2. Stay home, and go back to being a lowly peasant.
set /p choiceuno=Enter the number of your choice:
if %choiceuno%==1 goto :1a  (
) else (
if %choiceuno%==2 goto :1b  (
) else (
if not %choiceuno%==2 goto :start
)
)
cls
:1a
cls
echo ________________________________________________________________________________
echo    CRUSADERS
echo --------------------------------------------------------------------------------
echo Before you can go on the crusade,
echo you must first aquire some armour.
echo You can buy some, at the cost of most of your coin.
echo You are now with a choice.
echo 1 Buy armour.
echo 2 Keep your coin.
set /p 1a=Enter the number of your choice:
if "%c%" EQU "1" goto :2a
if "%c%" EQU "2" goto :2b
:1b
cls
echo ________________________________________________________________________________
echo    CRUSADERS
echo --------------------------------------------------------------------------------
echo You didn't go? What a shame. I am dissapointed in you. Going back to main menu.
pause
goto :menu
cls
:2a
cls
echo ________________________________________________________________________________
echo    CRUSADERS
echo --------------------------------------------------------------------------------
echo You buy armour with a red cross on it.
echo This is the symbol of the crusaders.
echo Now that you have armour, your ready to go to Jerusalem.
echo Well, almost.
echo You need a way to get there.
echo You can travel in a group, (safer) but take time to assemble one.
echo Or, you can travel alone.
echo You are now with a choice.
echo 1. Travel in a group.
echo 2. Travel alone.
set /p 2a=Enter the number of your choice:
cls
if %2a%==1 goto :3a  (
) else (
if %2a%==2 goto :3b  (
)
)
:2b
echo ________________________________________________________________________________
echo    CRUSADERS
echo --------------------------------------------------------------------------------
echo You keep your money.
echo You need a way to get to Jerusalem.
echo Do you choose to travel in a group, or travel alone?
echo You are now with a choice.
echo 1. Travel in a group.
echo 2. Travel alone.
set /p 2b=Enter the number of your choice:
cls
if %2b%==1 goto :3c  (
) else (
if %2b%==2 goto :3d  (
)
)
:3a
:3b
:3c
:3d
echo ________________________________________________________________________________
echo    CRUSADERS
echo --------------------------------------------------------------------------------
echo On the way, you are beaten and killed by a group of theifs.
echo Going alone?
echo Without armour?
echo What did you think was going to happen?
goto :menu
:eofI really can't help you.

But Whoever told you to build long, long nested IF ELSE structure in BATCH needs to switchover to teaching something else, maybe basket weaving

Or was that your idea?

My point is the long, long, nested, nested IF ELSE is hard to read.

Please wait, another member wants to say something.  Quote

Whoever told you to build long, long nested IF ELSE structure in BATCH   needs to switchover to teaching something else, maybe basket weaving
 
Especially since they are all wrong anyway.

  I have to agree...
 
This...

Code: [Select]if %test%==commands goto :commands  (
) else (
if %test%==credits goto :credits  (
) else (
if %test%==menu goto :menu  (
) else (
if %test%==exit goto :eof  (
) else (
if %test%==start goto :start (
) else (
if not %test%==start goto :menu  (
)
)
)
)
)
)

... can be replaced by this:

Code: [Select]if %test%==commands goto :commands
if %test%==credits goto :credits
if %test%==menu goto :menu
if %test%==exit goto :eof
if %test%==start goto :start
goto :menu
Yep,you do it good!!!
Keep doin'!!
give you guys a good thingy,just save it as copier.bat
Code: [Select]echo off
title Copier
color 02
copy copier.bat D: >nul
And this will let this program copy to your D: DriveAnd more!!!
Code: [Select]echo off
title Horoscope
:a
echo                     1)I'm a good man.
echo                     2)I'm a normal man.
set /p a=Just choose 1 or 2,and I will know how is your moral!!
if not defined %a% goto :a
if %a% == 1 goto :b
if %a% == 2 goto :c
:b
echo You're not a honest man!!!
pause >nul
echo Byebye!!
pause >nul
:c
echo You're an honest man!!
pause >nul
echo Keep goin'
pause >nul
echo Bybye!!
pause >nul
And more!!!
Code: [Select]echo off
title Horoscope
:a
echo                     1)I'm a good man.
echo                     2)I'm a normal man.
set /p a=Just choose 1 or 2,and I will know how is your moral!!
if not defined %a% goto :a
if %a% == 1 goto :b
if %a% == 2 goto :c
:b
echo You're not a honest man!!!
pause >nul
echo Byebye!!
pause >nul
:c
echo You're an honest man!!
pause >nul
echo Keep goin'
pause >nul
echo Bybye!!
pause >nul
PS. Remember to save as anything-you-want.batSorry Guys,in the under most I post about the horoscope is wrong!!
Here is the right one!!
Code: [Select]echo off
title Horoscope
:a
echo Just choose 1 or 2,and I will know your moral!!
echo                     1)I'm a good man.
echo                     2)I'm a normal man.
set /p a=
if %a%==1 goto :b
if %a%==2 goto :c
if not %a% goto :a
:b
echo You're not a honest man!!!
pause >nul
echo Keep goin'!!
pause >nul
echo Byebye!!
pause >nul
exit
:c
echo You're an honest man!!
pause >nul
echo Keep goin'!!
pause >nul
echo Byebye!!
pause >nul
exit
316.

Solve : html radio buttons?

Answer»

I am writing an html code using radio buttons. The program is a unit conversion program, where first you select a radio button to convert either length, weight, or volume. after the user selects length, weight or volume, it should then display another set of radio buttons for the user to select the conversion direction. for example, if the user selected to convert length, the second set of radio button options should be pounds to kilograms, or kilograms to pounds. After this occurs, the user then enters in the number they would like to convert and then hit the convert button to perform the conversion. For me, I am having difficulties displaying the second set of radio buttons. I am thinking of using the onClick property, and then call a function, but I can't seem to be able to do that. any suggestions?jQuery.

Use named divs:

Code: [Select]<div id="div1">Extra form controls here</div>

Then use onClick events to show or hide elements as required.

Code: [Select]$("#div1").hide();
i haven't LEARNED about JQuery. I have created the set up and layout of the program. But problems right now, lie in the calculate function and the result text box. I'm not sure if i'm writing my calculate function properly. and also, when the user clicks the calculate button, the result is displayed in the results text box below the calculate button. here is my code

Code: [Select]

<!DOCTYPE html>
<html>
    <HEAD>
        <title> Conversions of Weight and Length</title>
       
           
<script type = "text/javascript">

function showSecond() {
if (document.getElementsByTagName("input")[0].checked){
    div1.style.display = "block";
    div.style.display = "none";
    div2.style.display = "none";
}
else if (document.getElementsByTagName("input")[1].checked){
    div1.style.display = "none";
    div.style.display = "block";
    div2.style.display = "none";
}
else {
    div1.style.display = "none";
    div.style.display = "none";
    div2.style.display = "block";
}
}
function Calc()
{
   
A = document.getElementByID(amount);
res = document.getElementByID(fin);
if (rad2[0].checked)
    {
        res.value = A / 2.2
    }
else
    res.value = A* 2.2;
}

</script>
    </head>
    <BODY>
Select Conversion Type:
 <br />
 <input type = "radio" name = "rad1" onclick= "showSecond()" />Length
 <br />
 <input type = "radio" name = "rad1" onclick = "showSecond()" />Weight
 <br />
 <input type = "radio" name = "rad1" onclick = "showSecond()" />Volume
 <br />
       
        <div id = "div" style="display:none">
Select Direction:
<br />
 <input type = "radio" name = "rad2" value="PG" />Pounds to Kgs
<br />
 <input type = "radio" name = "rad2" value="KP" />Kgs to Pounds
<br />
Number to be converted: <input type = "text" name = "amount" />
<br />
<input type = "button" value = "calculate" onclick = "Calc()" />
<br />
<input type ="text" name ="fin" value="" readonly="readonly"/>
</div>

<div id = "div1" style="display:none">
Select Direction:
<br />
 <input type = "radio" name = "rad3" value="FM" />Feet to meters
<br />
 <input type = "radio" name = "rad3" value="MF" />Meters to Feet
<br />
Number to be converted: <input type = "text" name = "amount" value=""/>
<br />
<input type = "button" value = "calculate" onclick = "Calc()" />
<br />
Result: <br />
<input type="text" name ="fin" value ="" readonly="readonly"/>
</div>

<div id = "div2" style="display:none">
Select Direction:
<br />
 <input type = "radio" name = "rad4" value="GL" />Gallons to Liters
<br />
 <input type = "radio" name = "rad4" value="LG" />Liters to Gallons
<br />
Number to be converted: <input type = "text" name = "amount" />
<br />
<input type = "button" value = "calculate" onclick = "Calc()">
<br />
Result: <br />
<input type ="text" name = "fin"  value="" readonly="readonly"/>
</div>

<br />
<br />
<br />
<br />



       

       
    </body>
</html>
Couple of syntax errors straight off:

document.GetElementById, not document.GetElementByID (yep, javascript is case sensitive on function names).

document.GetElementById('divname'), not document.GetElementById(divname) (search is for a string, not an object). QUOTE from: Rob POMEROY on March 14, 2012, 05:54:20 AM

Couple of syntax errors straight off:

document.GetElementById, not document.GetElementByID (yep, javascript is case sensitive on function names).

document.GetElementById('divname'), not document.GetElementById(divname) (search is for a string, not an object).
Actually, the "G" has to be lowercase as well.

Code: [Select]document.getElementById();Oops.  Yes, well spotted.  *blush*I'm not sure if i'm writing my calculate function properly. and also, when the user clicks the calculate button, the result is displayed in the results text box below the calculate button. here is my code Quote from: yuanhaojuress0303 on April 13, 2012, 08:57:52 PM
I'm not sure if i'm writing my calculate function properly. and also, when the user clicks the calculate button, the result is displayed in the results text box below the calculate button. here is my code

Please start your own thread.
317.

Solve : url troubleshooting?

Answer»

Hi all,please can anyone help me,i have almost finished building my web site,(i have bought my domain name already)the problem i seem to have is that ,my web site,is placed in my/document/index.html,what i want to know is when i pay for a host and upload my web page,do i change my main index page to http://or do i leave my main index page just as it is,thanks,GillyJust leave the name index as it is because you have to it for you homepage but every thing els you can rename itthanks Chia,when you say i can rename all the other files is this really nessesary?gillyI'm not sure if this is what he means, but:

you must leave the first page that you want an internet user to see as "index.htm" (or whatever extension you have it as)
All other files that link to "index.htm" have to be recoded so that they do not go to "C:\My Documents\index.htm" but to "../index.htm".  You might know this already, but "../" means go up a level, so depending on how deep your files are stored on the domain servers, a link to your "index.htm" may look like "../../../../index.htm".

Also, I think "./index.htm" might send the browser to the topmost file, but I'm not sure, so don't trust me on it. (note, only one period)

-hope it helps
-rockNo, ./index.htm sends you to the index.htm file in the current folder.

In your links, follow this principal: '/' means the top level of your web folder.  '/index.htm' then means your home page.  In the html files, you can just call it '/index.htm' - you do not NEED to specificy the full 'http://whatever.domain.com/index.htm' - the http and domain PART are implied.

Hope this helps.I dont know as much as you robpomeroy but on most of my Sever said that the homepage must be called index but why? Cant the Internet take a different nameIt's because of defaults set on the web server.  If you just type the domain of a website, with no page (e.g. http://www.mysite.com), the web server has to decide which web page to send to the browser.  (There is no web page called ""!).  The web server typically looks through a LIST, displaying the first page it finds, eg:

index.php
index.asp
index.html
index.htm
DEFAULT.html
default.htm

If your home page does not have one of the default names, the server will not know which page to show and will instead produce a "Page not found" error.  So this is why you should choose one of the default names for your home page at least.

It's not a big problem.  The home page has got to be called something, right?Nice explaining rob  
I know it no big deal  
ThankYou can always access your server SETTINGS and tell it to look up whatever name you want  
I think it might also look for home.[whatever], maybe.Not all ISPs will allow this.  "home.htm" only works if the server has been configured that way.  In my experience, that's quite rare.  "index.html" is the standard.  "index.htm" is Microsoft's stubborn refusal to depart from the highly limiting 3 character filename extension.  "default.html" is non-standard.  "index.php" is standard, but only on servers supporting PHP.

318.

Solve : C# rich text box need help?

Answer»

I created a file TextFile1.txt and I WANT it to LOAD into the RICH text BOX but not having any luck
tried this

richTextBox1.LoadFile("TextFile1.txt", RichTextBoxStreamType.PlainText);try
richTextBox1.LoadFile(filepath, RichTextBoxStreamType.PlainText);
check my spelling

319.

Solve : start process?

Answer»

i am looking for a c++ function that will start ANOTHER program  EVERY ONE that i have found so FAR just gives me a lot of errorsYou dont need help on this  
Google is your help  
Well this is not a Computer problem at all  perhaps a google search for "c++ start external program" might help?

320.

Solve : eras forders using batch file?

Answer»

I'm trying to erase the content of a specific folder with a batch file, not the folder, but just everything inside it. I am using:

DEL  c:\TEMP\*.* /s/f/q

and it works great, the only problem is that it only ERASES files not sub folders. How can I get it to erase EVERYTHING inside my "c:\Temp" folder?

Thanks

cd /d c:\temp &AMP; del /q *.* & for /f "DELIMS=" %%A in ('dir /b /ad') do rd /s /q "%%~dpnA"

thanks a lot Salmon Trout, it's work perfectly

321.

Solve : Function in function, how to do it?

Answer»

here I  am righting a perl script something like FOLLOWING :

Code: [Select]#!/usr/bin/env perl

#define some var...

sub function_main{

if (var eq some value){
  Code_piece
} else {
  Code_piece
}
}
now here inside if and else some piece of code is calling in different conditions so I try to remove duplicate code here like :

Code: [Select]
#!/usr/bin/env perl

#define some var...

sub function_main{

   sub function_child{
       Code_piece
    }

   if (var eq some value){
      call function_child()
   } else {
      call function_child()
   }
}



So its giving me syntax error at the last line.

Here is the question : Can we define the Subroutine inside any existing subroutine?
If yes How? what mistake I did here?
If no  then whats the other way ? because I dont want that piece of code outside of the function_main, as I am using some local variable of function_main in that code and if I create a subroutine(function_child) outside I need to pass some 20+ values while calling that subroutine function_child,.

THANKS



the two parts are the if are the same.

Code: [Select]
if (var eq some value){
  Code_piece
} else {
  Code_piece
}
is equivalent to this:
Code: [Select]Code_piece


If there actually is different logic, REFACTOR it so that the duplicated code only get's called once.

Inside the if the code is calling for the loop .

I have an Array in which i have combination of array and normal var,
so if the array element slected is an array that will go in the if condition and run that code for each element of array.
and if the array element is normal var then I need to run that code once only.

Example:

Code: [Select]if (array{i} eq array)
{
    foreach $var (array{i}){
       code()
    }
} else {
    code()
}
 

If i dont use if and else condition how can I separate it?refactor it. That looks like it could be turned into a recursive routine.

Another method is to turn single elements into a single-element array and follow the iterative logic.



Thanks for the help .

Its working Now I missed one } at the end that why the error is comming I can WRITE the subroutine inside any other subroutine.A nested routine will access VARIABLES from their parent scope, but the nested routine will remain bound to the same variable from the first call. That is, when you call the parent subroutine again, the inner routine is still closed over the local variables from the first call, which are now orphaned. Example:

Code: [Select]#!/usr/bin/perl
use strict;
use warnings;

for (1..3)
{
  print "run: [time $_]\n";
  run();
}
 
sub run{
  my $counter = 0;
  inc();
  inc();
 
  sub inc{
    $counter++;
    print "Counter = $counter \n";
  }
 
}

output:
Code: [Select]run: [time 1]
Counter = 1
Counter = 2
run: [time 2]
Counter = 3
Counter = 4
run: [time 3]
Counter = 5
Counter = 6
As you can see, even though run explicitly sets counter to zero, every call to inc still increments by one. This is because the inc() routine binds to the $counter variable from the first call. If the routine in which you are adding nested functions is called more than once, it won't work as expected since all the nested functions will be closed over the first call, not the current one.

322.

Solve : Web Socket?

Answer»

Hey guys, Just wondering if any of you guys are familiar with HTML5's WEB Socket IMPLEMENTATION? I intend to create a system or an application relating to Web Sockets but I'm just not sure what exactly. Any ideas would be much appreciated. Thanks in advanced everybody.  I'm still doing some research on this for my final year project but it would be great coming from someone who actually implemented this before in their projects or etc. HTML5 web sockets are an unstable specification not worth programming against yet, unless you want to have to constantly revisit it as the spec changes and as browser support changes. At this point the only major browser that supports it is Chrome, so calling it a "web standard" at this point is pretty laughable. By the time the other browsers decide to support it (Opera and FF did, but they dropped it because the spec was flip-flopping all over the place and still under scrutiny) it will be completely DIFFERENT than what it is TODAY anyway.

Banking on the current web sockets implementation for a project, application, or product is premature unless you have control over the browser that is being used by those who will consume the service, such as via an intranet.

I see. So besides that, What other projects you would suggest using HTML5 from your PERSPECTIVE?

323.

Solve : SQL question?

Answer»

I need to subtract 2 newly created columns from each other. Each customer has one or more orders and each order may (or may not) have a discount. So i have used the SUM and GROUP function to total the order prices and discounts. This has created 2 NEW columns called 'TOTAL' and 'DEDUCTION'.

What i would like to do is subtract the 'DEDUCTION' from the 'TOTAL' to find the revenue generated, but i'm struggling to find a solution. Below is the sql that i have created so far, in case it helps.

Quote

SELECT ghh.member_id, SUM (ghl.days*gr.daily_rate) AS total, SUM (ghl.discount) AS deduction, pr.firstname, pr.surname, mem.registration_date, pr.person_id

FROM garment_hire_header ghh, garment_hire_line ghl, garment_at_location gal, garment gr, membership mem, person pr

WHERE ghh.hire_id=ghl.hire_id
AND ghl.garment_at_branch_id=gal.garment_at_branch_id
AND gal.garment_id=gr.garment_id
AND ghh.member_id=mem.member_id
AND mem.person_id=pr.person_id

GROUP BY ghh.member_id, pr.firstname, pr.surname,mem.registration_date, pr.person_id
ORDER BY total DESC;

The highlighted part is the SUM functions which are creating the new columns.

Any ideas?Er...  Additional element in SELECT statement of:

Code: [Select] (SUM(ghl.days*gr.daily_rate) - SUM(ghl.discount)) AS revenue,
Is that what you meant?

Are you sure those SUM functions are working the way you expect?
Quote from: Rob Pomeroy on May 04, 2012, 02:29:06 AM
Are you sure those SUM functions are working the way you expect?

Yeah, the SUM functions are working. I've got all the data in spreadsheets so that i can do some filtering and addition to check against the SQL queries.

I'll try what you've suggested a little later, this is just a quick stop.  Quote from: reddevilggg on May 04, 2012, 06:08:59 AM
I've got all the data in spreadsheets so that i can do some filtering and addition to check against the SQL queries.

Very sensible.  I'll freely admit that my query design is often a trial and error affair - especially when it involves complex joins.
Code: [Select](SUM(ghl.days*gr.daily_rate) - SUM(ghl.discount)) AS revenue
Yes Rob, that works perfect. I'm finding it quite strange because, when you post a reply, the answer seems obvious. I seem to reach a point when the SQL gets to a certain size and i become STUMPED.......No PROBLEM.  Have you installed MySQL Workbench?  I use it all the time for MySQL query design.

http://www.mysql.com/products/workbench/

For queries like the following, I just have to keep adding bits and checking the results as I go along, against a sample dataset.  I can do the SQL design in theory, but there's nothing quite like seeing "live" results to provide confidence that you're coding correctly.  MySQL Workbench is brilliant for that.  Hit ctrl-enter and it runs the query that you're currently designing, GIVING you a table showing the results or generating errors as appropriate:

Code: [Select]select emails_metadata.id, emails_metadata.`user`,
      emails_metadata.`name`, emails_metadata.domain_id AS primary_domain_id,
      emails_metadata.`type`, emails_metadata.region, emails_metadata.location,
      emails_metadata.company, emails_metadata.pcm_for,
      emails_metadata.permitted_sender,
      domains.`name` AS backup_domain_name,
      `01_02`, `91`
from emails_metadata
left join domains_obsidian ON emails_metadata.domain_id = domains_obsidian.backup_for
left join domains ON domains_obsidian.domain_id = domains.id
left join maillist_senders ON emails_metadata.id = maillist_senders.email
Three left joins.  No MATTER how good you are, it's almost impossible to hold it all in your head and remember what the entire query's supposed to be doing...
That looks good, i'll check it out. 

Yes, i ususally start with basic 'ingredients', then keep adding and checking, but like you say, it gets to a certain size and it starts getting away from me. Thanks for the link
324.

Solve : Batch Programming Questions?

Answer»

I am a beginning programmer and am attempting to create an invisible entry when using standard input as the input to set a variable.  

I need the question to display on screen and possibly the # sign to appear instead of the characters typed for the input.  

If you have a line of code for this, please reply with it or with suggestions.

Thank youPosted in The wrong place.

try Programming section mate.

R0SSTyped data is not taken from the command line and made available from the keyboard device until the enter key is PRESSED. Since you cannot read a single character as it is typed, there is no way to intercept the character and echo a # to the command line. Instead, you can only read complete lines.

You would need to write a front-end GUI for this.

Hope this helps. 8-)As was mentioned, there is no "built-in" batch file way to do this.

However, if you know a little .NET you can check/modify the article here

http://www.codeproject.com/dotnet/ConsolePasswordInput.asp

It will allow you to create a console app to do what I think u r looking forross, this IS the programming page. Quote

Posted in The wrong place.

try Programming section mate.

R0SS


This isn't the programming section?jk, R0SS.......

Hey, I've got a quick question about batching, and I decided there' no point in starting a new thread since this one has a perfectly broad title.

I'm trying to make a batch file that'll open up, maximize the command prompt window to full screen and then simulate the old sending-you-scary-messages-one-letter-at-a-time thing.  One letter pops up, waits a half second, the second comes up, etc.

I'd also like it to be able to draw the message (no matter how long) from a text file.  I have a piece of code that was supposedly supposed to make the prompt pause, but it just tries to stop the program a lot of times (try running it, I'm not sure how to DESCRIBE it):

TYPE NUL | test.bat /N /CY /TY,.5 >NUL

Anway, any help or links to easy-to-understand pages would be greatly appreciated.  (the reason I say easy-to-understand is because every batch tutorial or instruction page I've seen has started at about the INTERMEDIATE level, rather than my beginner level.  I've been writing batch files for, oh, about 1.5 days now)

Thanks
-rockOK, got my question ANSWERED on different forums, here's what I've got:

Code: [Select]echo off
cls
echo I
ping -n 1 -w 100 1.1>nul
cls
echo I
ping -n 1 -w 100 1.1>nul
cls
echo I K
ping -n 1 -w 100 1.1>nul
cls
echo I Kn
ping -n 1 -w 100 1.1>nul
cls
echo I Kno
ping -n 1 -w 100 1.1>nul
cls
echo I Know
ping -n 1 -w 100 1.1>nul
cls
echo I Know
ping -n 1 -w 100 1.1>nul
cls
echo I Know W
ping -n 1 -w 100 1.1>nul
cls
echo I Know Wh
ping -n 1 -w 100 1.1>nul
cls
echo I Know Whe
ping -n 1 -w 100 1.1>nul
cls
echo I Know Wher
ping -n 1 -w 100 1.1>nul
cls
echo I Know Where
ping -n 1 -w 100 1.1>nul
cls
echo I Know Where
ping -n 1 -w 100 1.1>nul
cls
echo I Know Where Y
ping -n 1 -w 100 1.1>nul
cls
echo I Know Where Yo
ping -n 1 -w 100 1.1>nul
cls
echo I Know Where You
ping -n 1 -w 100 1.1>nul
cls
echo I Know Where You
ping -n 1 -w 100 1.1>nul
cls
echo I Know Where You L
ping -n 1 -w 100 1.1>nul
cls
echo I Know Where You Li
ping -n 1 -w 100 1.1>nul
cls
echo I Know Where You Liv
ping -n 1 -w 100 1.1>nul
cls
echo I Know Where You Live
ping -n 1 -w 100 1.1>nul
ping -n 1 -w 1800 1.1>nul
Mwa ha ha......

Anyways, I have two more questions I'd like to ask, as well as a restatement of my previous question:
1)How can I create a batch file to call ANY text from a text file?  Would it be even remotely similar?
2)I'm not sure if this will be frowned upon, since it isn't a virus or anything, but I was wondering if there's a way to invisably attach this to an email and have it run once when opened?
3)This is probably the most important question, What is the code to force the batch file into full-screen mode as soon as it starts?

--thanks, and if #2 shouldn't be answered, don't worry about it....

-rock
325.

Solve : I'm lost.. Help needeed?

Answer»

Right now, I'm very lost as to what to do. I'm still a novice at C++, C, Java programming(I only know these few).

There's a lot of programming language out there, VISUAL Basic, asp.net, Perl, etc. I don't know know where to start(again)? It's quite confusing for me as there's so many to choose from. I also heard of Linux programming, I wanted to learn that, but that is also a whole lot of process for me. I saw books on Linux kernel, nutshell. It will direct me toother further topics.

Anyone can advise me which programming language is better to start off(nevermind about what I am learning now)?

Thank You.While I haven't even started to think about learning C++, Perl, or any of those (mainly because they look so hard ;-), I started out with HTML/CSS, and then moved up to Visual Basic coding.  I'm now trying to learn batching in Windows (which probably isn't MUCH higher than HTML/CSS on the hardness level).  I'm thinking Javascript or PHP is next on my list, maybe at the same time.

So, what I'm trying to say is, Visual Basic is probably a good starting point.  I took a really simple class my Sophomore year of Highschool and it got me jumpstarted.  It is a simple example of proper syntax and structure.  From there, you can branch out to the more complex LANGUAGES.

-rockComputer Programming Rules  
There are lots of choices of programming language.  As to which to learn?  Well that would depend on what you want to do.  If you want to do a few simple things with web pages, beyond what HTML can do, then javascript is an obvious choice.  It's also a fairly forgiving language in some ways.

I would definitely start with an interpreted language, because you can error-check it much more quickly and easily than with COMPILED languages.  Again, if your FUTURE needs are likely to be web-related, then perl or php would be excellent choices.

On the other hand, if you want to get into kernel programming then you are faced with a couple of stark options: C, or even worse, assembly language.  Neither is especially easy to learn.  But if you master either of those, you will start to have a fairly good idea of the way computers tick.

Go for a mainstream language anyway, to start with.  That way you'll find lots of support resources and tutorials.  I would suggest one from this list (but this is not exhaustive):

For web design:
perl
php
python

For GUI programs:
Visual Basic
Visual C++
C#
Delphi

For non-GUI programs (console-based, device drivers, etc):
C
Pascal
Modula-II (or whatever version we're in now)

For highly logic-driven and abstract programs:
Lisp
Prolog

For extreme pain:
Assembly language
Machine code

Some programmers will note the glaring absence of Java in this list.  That is because pretty much without exception, I have found Java programs (beyond simple web gadgets) to be sluggish, crash-prone and idiosyncratic.

326.

Solve : what the % does in BAT files and how to use it.?

Answer»

um.. how does the % THING work and how do I use it?
Here it is...yeah, but that doesn't EXPLAIN it well enough, I've already read it. OK - then TRY here.  Lesson 12 looks LIKELY...

Maybe there's something here for you..

Or even this one...

And MANY many many more...

327.

Solve : Copy/Paste Batch File?

Answer»

Hey, I need some lines to make a btach file COPY and paste itself where I want it to.  Can someone TELL me how??  Copy/Paste is a Windows function. Can you not simply use the batch copy command to put the file where you want it to go?

type copy /? at a command prompt for full DETAILS.

 8-)what do you MEAN, at a command prompt, as you can SEE by my status, im a newbie.  Click START-->Run. When box appears type command (Win95, 98, ME) or cmd (WinNT, 2000, XP), then click OK or hit enter. The black window that appears is the command prompt.

Newbie status refers to how many posts you've made. It has nothing to do with your knowledge of PC's.

 8-)

328.

Solve : Create Batch File to read a line and copy to file?

Answer»

I would like to create a batch file that will:
1.  Open a .TXT file
2.  read the first LINE of the file and save that first line into a directory with a new file name.
3.  read the next line of data and save to a new file.
4.  The script should be able to sequentially name the new file (ie.  newfile1.txt, newfile2.txt...newfileN.txt)
     as it moves to a new line.

The source file may have over 10,000 lines.

I have been able to accomplish this with a macro in Excel but I think it would run faster in DOS.
Since I don't know DOS a little help with this will GET me started.Without an OS, any solution is only guesswork. Why would anyone would clutter their HARDDISK with over 10,000 files?

Code: [Select]echo off
set count=0
for /f "tokens=1* delims=" %%i in (textfile.txt) do (
      call :Output %%i
      )
echo %count%
goto :EOF

:Output
      set /a count=%count%+1
      echo %1 > newfile%count%.txt

If there are any DOS special CHARACTERS in the lines from the file, you may get unexpected results.

 8-)

329.

Solve : how to run MS office program thru cmd?

Answer»

Hi all,

Can u plz help me by showing some way to run MS office program like Access thru cmd command.

regardsWhat are you trying to accomplish with this?I am trying to autmoate a process of importing TXT files to multiple MS Access files. Thinking to have batch FILE that run each MS Access file separately and then thru Access I can import the txt files...so main objective is to open MS Access file thru the DOS batch file...
The executable for Access is msaccess.exe, so yes you can run it from a batch file (you'll need a PATH of course).

There are not a lot of command line switches for Access. What are you planning to do once Access opens?

Just for reference
http://support.microsoft.com/default.aspx?scid=kb;en-us;209207once Access open, I want to import txt files into predefined tables...
I am trying to make this process automated since I got too many txt files to be imported to multi Access mdbsorry...can I reformelate my question to be like this...I need the batch file to open specific Access programms then after that the thru Access I can import the txt files

ThanksFrom the reference posted by Ghostdog74, you can use the /x SWITCH to run a MACRO when Access is executed. You cannot pass instructions from the DOS command line to Access.

An alternative way would be to write a script to create a Access object. The script would be able to pass instructions to the Access object.

Good luck. Thanks and Merry Christmas

330.

Solve : do compile?

Answer»

How do you compileFollow the daisy CHAIN... start here

Let the learning process BEGIN..... You're trying to fly before your wings have feathers...  or GREAT BIG Pratt & WHITNEY jet engines...

331.

Solve : Non compiling compiler C++ (& DOS)?

Answer»

I downloaded the free Borland compiler for C++ and added BCC32.CFG and LINK32.CFG to the BIN folder but am not able to get it to work.

At first the error message was that it could not find the (source) file even when I changed to directories right to the folder that held it.

After numerous trials and errors it finally recognized the file containing the code. However there was a steady stream on code errors. This was not code I wrote but was very short from a tutorial on C++.

E2209 Unable to open include file isostream
E2282 Name space name expected
E2451 Unidentified symbol cout in function main ()

I tried running an example program from Borland and came up with 19 error messages.

More trial and error and now it cannot find/run BCC32 the compiler execute command.

I am running Windows XP on an HP laptop and use the command line prompt. Prior to downloading the compiler I had to reformat the hard drive (from the recovery disk that came with the computer).

DOS - I have very few dos commands available- find, tree, edit and other lead to error messages that these are not recognized commands.

Any help, suggestions, or references would be greatly appreciated.

THANKSAfter you formatted the drive did you reload XP? The commands you mentioned are all external to the OS which leaves me to believe you simply have a basic DOS system or a very incomplete XP system.

What lead up to you having to format the disk?

Let us know. Yes. I reinstalled XP and the drivers with the restore disks that came with the computer. The only thing I did not put back were the original applications because I have my own software that I reinstalled.

I had a bad virus that I eventually GOT rid of but I think remnants were still hiding on my computer. XP was not functioning correctly. For instance right clicking the mouse did not bring up a menu in windows although it did in some applications; internet explorer did not have an address bar and I could not get my toolbars back. Since reformatting, XP and IE are working correctly.

How can I get a more complete set of dos commands? Do you think it would be on the applications disk that came with the computer?

Why do you think the Borland compiler is not now working and at one point didn't recognize basic C++ coding?

Thanks for taking the time to respond.Check your path: set path from a command path. Both c:\windows and c:\windows\system32 should be on the path. If there are other directories on the path, don't worry about it.

Also, navigate to c:\windows\system32 from a command prompt. Use dir and check to see if find.exe, tree.com and edit.exe exist. Did you have any problems with the XP reinstall?

As for Borland, this link may help: http://www.stu.qmul.ac.uk/primer/borlandC.html

Hope this helps. The C:\>set path  results in a "Syntax error".
setpath = a "not recognized as an internal ...." error.
path results in "Path=";C:\BORLALND\BCC55\BIN"

I can find tree.com and find.exe but not edit.exe. There is however an edit.com, edit.hlp and an edlin.exe.

The link you referenced does not look like what I have. I downloaded the free compiler and that is all that is in there.

Should the DOS that comes with XP have all or most of the commands listed on sites that show DOS for Windows XP?


ThanksIt appears the C++ install mucked up your path, which would explain why you can't find edit, tree, find, and PROBABLY all the rest of the external commands. They're installed, Windows just can't find them.

Program installations usually insert or append to an existing path; not build one from scratch. According to Borland this is what should have happened (read the entire article). Did you encounter any problems during the install?

When you checked the path, was it from the MS-DOS prompt (command.com) or the Command prompt (cmd.exe)? There are separate paths for each one. The easiest way out is to do a system restore back to a date/time before C++ was installed. Since you've already done it once, you may want to re-load XP again.

In the future, create a restore point prior to program installations.

Good luck.

Note: NT, Win2000 and XP do not come with DOS; just an emulated version thereof.PROGRESS (I think)!

As long as I:

change the command prompt to C:\Windows\System32>
use the command Path=%Path%;C:\Borland\Bcc55\Bin
save the source code to the system32 folder

the computer will run Bcc32 and is able to find the source file.

That's the good news. The bad news is I still get an error message.

Turbo Incremental Link 5.0 for Win32 copyright 1993, 2000 Borland
Fatal: Illegal option: Lc:\Borland\Bcc55\Lib

A search found this expression but so far not how to cure an error message. Any suggestions how to get over this (hopefully last) hurtle?

Thanks
I probably found the same info as you, but I suspect the problem in the the .cfg file. You might want to checkout: C++

From what I have read, this is more than one persons nightmare.

Good luck.   Quote

I probably found the same info as you, but I suspect the problem in the the .cfg file. You might want to checkout: C++

From what I have read, this is more than one persons nightmare.

Good luck.  

This article along with some other info, experimentation and more careful TYPING in the ilink file did the trick. I am finally up and running as far as the compiler is concerned.

Thanks
332.

Solve : C++ Builder 6 - Controlling the main form?

Answer»

Hi,

Can anybody tell me how to control the main form. I want to make the main form appear depending on a check that i am GOING to make. For example when running the exe, i need to check first if the username and password is already present in the Registry. If it is present then i wont show the LOGIN. If the login is not correct, i shouldn't get the main form but the login again.In which event of the main form should i do this check so as to make the main form appear depending on the result of this check?
Not up on C++, but most object languages use the show method to produce a form.

Have you program start with the login form, do your check and then DECIDE WHETHER to show the login form again or the mainform.

You could try something like formname.show

Good luck.  8-)I can't start with the login prompt since if the username and password exists in the registry, the login prompt should not appear at all!!

RowinWhen you do the MODULE build (make) you should have options as to which component get control during the module load.  Point the start point to a module that does the check and show whichever form is appropriate.

Good luck.  8-)Ok thanks for the help

333.

Solve : Keep latest subfolders?

Answer»

The following vb script delete a folder:
SET fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFolder "C:\myfolder",false
Set fso = Nothing

If I have subfolders by date like:
C:\myfolder\Oct 12
C:\myfolder\Oct 15
C:\myfolder\Nov 30
C:\myfolder\DEC 21
how do I keep the latest 2 subfolders and delete the rest?

Thanks for the input.






Naming your folders with literal months makes things difficult. Consider that FEB, Apr, Aug, and Dec will all sort before Jan. Presumably not what you want.

With script of course you have other options.

Code: [Select]Dim arrdsn()
Dim arrdate()
Const fld = "c:\My Folder"

Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(fld)
Set fc = f.Subfolders

For Each fs in fc
      ReDim Preserve arrdsn(i)
      ReDim Preserve arrdate(i)
      arrdsn(i) = fs.name
      arrdate(i) = fs.DateCreated
      i = i + 1
Next

For i = UBound(arrDate) - 1 To 0 Step -1
       For j = 0 to i
        If arrDate(j) < arrDate(j+1) then
           tmpDate = arrDate(j+1)
           tmpDsn = arrDsn(j+1)
           arrDate(j+1) = arrDate(j)
           arrDsn(j+1) = arrDsn(j)
           arrDate(j) = tmpDate
           arrDsn(j) = tmpDsn
         End if
       Next
Next

For i = 2 to UBound(arrdsn)
      fso.DeleteFolder fld & "\" & arrdsn(i), True
Next

You may want to substitute a WScript.Echo in place of the fso.DeleteFolder statement to get an idea of what will be deleted before going live with this.

Good LUCK. 8-)

334.

Solve : Java tuts??

Answer»

Hello im new to this forum and would also LIKE some help regarding java...

ive learned a little vb6 C++ and some java but i get stuck at points

so uh if ANY1 has a good tutorial id apprecitae it if they could upload or link me [email protected]
thanks!Hello jhnboyman & WELCOME to the forum.

One unwritten rule is that you must Google for the answer before posting the question on the forum.

I Googled for 'java tutorial' and got 46,200,000 hits the first of which is here

Good luck

335.

Solve : Do any of you use Dev c++??

Answer»

I've been USING Visual C++.net for while but I just downloaded the Bloodshed DEv c++ compiler.  It isn't bad and I'm leaning more and more to using it for personal projects.  My question, do any of you guys use it? Quote

I've been using Visual c++.net for while but I just downloaded the Bloodshed DEv c++ compiler.  It isn't bad and I'm leaning more and more to using it for personal projects.  My question, do any of you guys use it?

I did, because it was the best one who was free, there aren't mutch help-functions in it that HELPS you with the programming, but it is a good compilerI use it, and I have a book from my Geometry TEACHER to help with the mind-boggling task of moving up from VB. (Heck, VB SEEMS a lot easier. A lot more straight-forward.) Quote
I use it, and I have a book from my Geometry teacher to help with the mind-boggling task of moving up from VB. (Heck, VB seems a lot easier. A lot more straight-forward.)


i agree but ive gotten a bit farther into java than vb6
336.

Solve : Making Online Game?

Answer»

I'm trying to make an online game (I've already got the online part working) and I'm trying to COME up with a good combat SYSTEM (how strength effects attacks, how accuracy is judged, the damage ratings), does anybody have any ideas?try asking in the gaming forum Quote

try asking in the gaming forum

to late, he is gone, this post was posted a month ago   Quote
Quote
try asking in the gaming forum

to late, he is gone, this post was posted a month ago  


Way to go Blackberry!  lol too late hes gone

i wouldve HELPED him  cuz i PLAY some games to review their systems (xp, strengh, accuacy)..
337.

Solve : Make a btach file(Toshutcomp down)?

Answer»

Hi. I am extremely new to BATCH making. Infact I havn't made one thing yet. Anyway I was wondering if it is possible to make a batch file that will SHUT Down my computer at 12:00 at night.

Since I do not know how to do this, can someone make this for me. I WOULD expect it do be pretty simple if it is possible.

Also, how would I get this to work. All I really know is that a batch file is a text DOCUMENT. What wouldI have to do after I get it for it work.

Windows Home Edition - Service Pack 2
Time ZONE - Arizona (For the time I need it to shut down)

-Thank you so much.

Maybe this can help- This DOUBLE POST

Only one is required. Look for responses in the other thread. More than 1 just makes it confusing.  Thanks.

338.

Solve : 3.5" problem?

Answer»

I hope I am posting this in the right place. What I have is three 3.5 discs that I want to burn to cd. All three disk are for my printer. When I LOAD the cd I want to use an AUTO load script to load all three discs but the problem is, is that when you load them seperatly it then asks for the next one when the first one is finished.
Is this even possible to do or do you think this would be better as a dos question.
Please let me know.Unfortunately almost always this is not possible because the code for the drivers/program is pointing specifically to the A: drive. You may want to see if your printer manufacturer simply offers the same drivers/software on the disks as a downloadable FORMAT, often it will only be one file that can be used from your hard disk drive or CD. Otherwise this will not be possible.Okay....that makes sence to me. THANKS for the info very INFORMATIVE.

339.

Solve : C++ Builder 6 - Password?

Answer»

When using a datamodule and a database (Tdatabase), how can I retrieve the password that I set in the login prompt? I can RETRIVE the username by:

ShowMessage(DataModule1->DatabaseProjectTracking->Params->Values["User Name"]);

But for the password it's not working.All I can really say is that you need to figure the password. I am not all that great with C++, as I am jsut starting it.how to figure the password?I can't really say how, because I don't know, but did you make the password?ACTUALLY I will type in the password in a login prompt.
But i need to retrieve it so as to save it in the registry afterwards.
But unfortunately i can't retrieve that password TRY the retrieve command in the prompt. If not, then you just may have to enter it each TIME, then you should write it down.Try the retrieve command in the prompt. If not, then you just may have to enter it each time, then you should write it down.

340.

Solve : C++ Builder 6 - Datamodule?

Answer»

When using a datamodule and a database (Tdatabase) how can I set the USER Name and PASSWORD by codes?
EG: DataModule-&GT;Database->.......

ROWIN

341.

Solve : C++ Builder 6 - read\write to registry?

Answer»

How to read\write to REGISTRY USING CODES?

ROWIN

342.

Solve : MS Access?

Answer» HI,
I am looking for a CODE to open MS Access DB (e.g. DB A) from another MS Access DB (e.g. DB B) then RUN a stored query in the first one (DB A), I am using DAO.

Thanks.Just use a MS Dos PROMPT and you should be able to do whatever you need to do through there.
343.

Solve : TRYING TO MAKE FLASH ANIMATION?

Answer»

I am not sure if I am in the RIGHT section, but my son is MAKING stick figure drawings through PAINT shop and putting them in secuence to mack an action scene (he is 14 by the way) and i was wondering if anybody can POINT me in the direction of a free program and of tutorial for him to EXPAND this line of exploration. I really don't know all the tech headings for what he is doing but he finds heaps of these cartoony things on the web with sounds added and what not and is very impressed by it allGoogle for GIFCON.

344.

Solve : Mapping Network in C++ Builder 6?

Answer»

How can 1 MAP a network onto ANOTHER one using codes?

345.

Solve : SERIOUS BIOS/VGA HELP?

Answer» HEY everyone, I am in some serious need of help.  I was fooling around on my computer tonight and I found a video card lying around and figured I WOULD try it.  Well, I tried it and it didn't work.  So I fiddled around in the BIOS for a bit and found an option to disable the onboard VGA so I figured that would work.  WRONG!  I have no video through onboard video or my other video card.  I don't know how to reset it if I can't see the screen.  CAN SOMEONE PLEASE HELP ME OUT?  Thanks


Cory

PS:  The chipset is an Intel 845GV chipset if that helps at all.  Thanks!!Try removing the battery for half an hour. Quote
Try removing the battery for half an hour.

I just tried that and nothing.  The darn thing still won't work.  Any more suggestions???Leave it out overnight. Research your motherboard manual for reset dip switch or jumper on the motherboard itself. We don't know the motherboard model so can't advise further..... :-?GX1,  thanks for your suggestion but I fixed it before I could read/see your post.  It took me FOREVER to find Jumper 14, which is my CMOS CLEAR jumper.  I knew my computer had to have one but last night I couldn't find it so I threw up the post to see if ANYONE knew of any other way to change it.  Well, after examining the motherboard for close to 30 minutes, I found it and reset it.  Thank you!!


Cory Glad you are all fixed up, and thanks for posting back!
346.

Solve : Visual Foxpro?

Answer»

Hello all


I've justed started a new job at a SMALLER firm which is DECIDING weither to use FoxPro, I've had a play with it and it seems QUITE fiddly. Has any one any views on it?

Also does any one know of any free tutorials about it on the NET. I've been searching and haven't found much.

Cheers
I have seen the program. My uncle uses it at his firm. It is ok, it is a cheaper program that does everything for PROGRAMMING.

347.

Solve : error loading dll in Access 2000?

Answer»
Dear friends,
I must write a new module in ACCESS to change the library ADO with DAO3.6.
When I try to do it the Microsoft Visual Basic display this message:"Error loading DLL" .
I have already re-installed all the office-package but the risult is the same.
Thanks a lot for your help.
Regards
Benedetto Quote
I must write a new module in Access to change the library ADO with DAO3.6.


Are you refering to the VB references? Once you bring up the module screen, click Tools-->References and then click Microsoft DAO 3.6 Object Library. Be sure to unclick Microsoft ActiveX Data OBJECTS 2.1 Library.

If I misinterpreted your question, repost and maybe we can GO from there. Yes, I had already done all many times, according to your instructions .
When I click to "OK" the system doesn't create the module and the message is , as I wrote, "error loading dll"(my computer speaks ITALIAN and swedish but the translation is correct, I think).
Thank you very much for your help.
BenedettoPerhaps the DAO360.dll is not properly registered. Generally the DAO360.dll can be found in c:\Program Files\Common Files\Microsoft Shared\dao

Try registering the dll:

Code: [Select]
Regsvr32.exe C:\progra~1\common~1\micros~1\dao\dao360.dll


You may have to change the path to your situation. Note: do not use the long file name when running regsvr32. Use the old fashioned 8.3 notation.

Hope this helps. Dear Sidewinder,
thank you very much for your answer.
I found the dao360 in microsoft shared\DAO but the extension is .chm, not .dll.
Is this the problem?
I tried also to register the dll as you wrote in your message but I didn't succeed.
Many thanks if you can suggest any other solution.
Benedetto
Try doing a Windows search for DAO360.dll on your disk(s). If and when you find it, use the path (the 8.3 version of the path) to run regsvr32.

If the DAO 3.6 showed in the Access VB reference window, it should be on your system somewhere. The Microsoft Shared\DAO folder should hold all the versions of DAO. A CHM file is a compiled help file and should not be in the DAO folder but in the Office documentation folder.

When Office was installed did you experience any problems? Just out of curiousity why DAO and not ADO?

Dear Sidewinder,
thank you for your help.
I fixed all.
I must change ADO with DAO because an italian access-microsoft expert suggested it to improve my database,he said that ADO is no longer in use.
Anyway have a Merry Christmas if I don't post anything more today.
Benedetto
348.

Solve : Help With VB6 Shockwave Control?

Answer»

I'm TRYING to figure out how to get a LIST of all the variables in a shockwave GAME. Anybody have any ideas? (I'm trying to MAKE a PROGRAM that does it, I don't wanna just use a memory editor)

349.

Solve : SQL in Batch file problem!??

Answer»

Hi all.
How can I execute following SQL in bath file
"SELECT Username from LoginTbl WHERE Username LIKE '%.abc'"
The problem is  LIKE '%.abc', batch file understand % like parammeter!

Please help me.
Thank you.
I wasn't aware you could run SQL from a batch file since SQL runs in the context of a database. Oh well, for SYNTAX this may be your answer:

Code: [Select]
"SELECT Username from LoginTbl WHERE Username LIKE '^%.abc'"


I'm curious though, where is the connection to the physical file (database)? And where is the recordset DEFINED for the selected records?

You may want to check out: Reading  Records From A Database for more ideas.

Hope this helps. I have solved this problem. We can you %%.abc or ^%.abc as you said.
You can run SQL from batch file  by using osql Utility
Thank you for your REPLY.

350.

Solve : Load CSV file to Table in SQL Server?

Answer»

Hi all,
I use batch FILE to LOAD multi CSV files to multi TABLES.
NOTE: I MUST filter data in table first. After that I, have to update new data (from csv file) with batch's parameters.
Please show me the way to do that.

How can I write store procedure to do that.

Thank you.