InterviewSolution
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.
| 1301. |
Solve : c++ winapi - menus? |
|
Answer» is it POSSIBLE to create CONTEXT MENUS from XML or INI files? |
|
| 1302. |
Solve : Just a little help? |
|
Answer» I,m running windows XP Pro on HP comp. and for some reason the system restore will not work. could you give just a little more info? And explain what this has to do with programming? |
|
| 1303. |
Solve : VB.net code convert feet to meters? |
|
Answer» I am NEW to the programing enviorment I needed some help CREATING a program in vb.net for my HOME work to Write the code to PERFORM calculations that convert feet to metres (0.3048)Welcome to the CH forums. Members generally do not assist with homework as doing so would mean that you could present our work as your own. Your tutor may then believe that you fully understood the task which had been given to you when the truth is that you didn't. Please contact your tutor for advice on how to proceed. Good LUCK. |
|
| 1304. |
Solve : not using cin?? |
|
Answer» Im making a game in C++, and I need something to the effect of: if(ButtonPressed(Left)){DoThis();} Got any ideas?Like, instead of the user having to TYPE "L" and then press ENTER, being able to just press the left arrow key? Any way to do this in C++?GetAsyncKeyState()Not got a chance to try it yet, but if it WORKS (and I dont doubt it will)... Thank you, thank you, thank you, and thank you again!it is a windows API function. you will need to include "windows.h". |
|
| 1305. |
Solve : Form loading problems - VB 2008? |
|
Answer» Hey guys, |
|
| 1306. |
Solve : Automatic opening file Question? |
|
Answer» Well, IM trying to make some autorun program, so that when i open a program, well lets say its Warcraft 3, I want the autorun program to open ANOTHER file when Warcraft 3 Opens. So what im trying to say is, i want an auto run program to open a file automatically upon Warcraft's start up. Does anyone know what im trying to say? Not a clue! Quote I want the autorun program to open another file when Warcraft 3 Opens What type of file (program?, audio?, video?) You profile does not mention an OS, but I'm guessing Warcraft 3 runs in Windows. One way would be to MONITOR when Warcraft is started and immediately start what you refer to as an autorun program. Another method would be to create a batch file that runs both the autorun file and Warcraft. The usefulness of a batch file would DEPEND on what the autorun program is. Bottom line: We need more details. Ahh Sorry eh, Im still new to this thing but thanks for msging in thsi topic. Right, its for a Windows XP Computer, I want a program, some file in which i can create from basic window xp tools to run a file when i click on it. Im thinking its what you call the batch file, so i wnna click on this batch or autorun file and it will open Warcraft For Me. Would it be possible to open two programs from one batch file ?You can use notepad to create a batch file: Code: [Select]@echo off drive:\path\warcraft Save the script with a bat extension. Run from the command line as scriptname or find the batch file in Windows Explorer and double click the file. I don't know the path or the name of the WarCraft program, so you'll need to fill in those details yourself. Quote Would it be possible to open two programs from one batch file ? Yes. As ALWAYS, the devil is in the details. |
|
| 1307. |
Solve : SQL Dumper? |
|
Answer» Whenever I start up my LAPTOP I GET a MESSAGE that I that the SQLDumper installation failed. I dont know how to remove this, and I am not that great with computer programming. SQLDumper seems to be a component of numerous Microsoft products: VISUAL Studio, SQL Server, Office, and the Accounting program. Do you now or have you ever had any of the mentioned products installed? |
|
| 1308. |
Solve : Flash Variables? |
|
Answer» ACTIONSCRIPT 3.0 I have this code: Code: [Select]var W = 0; var C = 0; function CInfo_Open(e:MouseEvent):void { if (W == 1){ << Problems with WTeacher_Info.play(); <<This code var W = 0; if (C == 0) { CTeacher_Info.play(); var C = 1; } } C_btn.addEventListener(MouseEvent.CLICK,CInfo_Open); function CInfo_Close(e:MouseEvent):void { if (C == 1) { CTeacher_Info.play(); var C = 0; } } C_btn.addEventListener(MouseEvent.CLICK,CInfo_Close); function WInfo_Open(e:MouseEvent):void { if (C == 1){ << And This CTeacher_Info.play(); <<Code var C = 0; if (W == 0) { WTeacher_Info.play(); var W = 1; } } W_btn.addEventListener(MouseEvent.CLICK,WInfo_Open); function WInfo_Close(e:MouseEvent):void { if (W == 1) { WTeacher_Info.play(); var W = 0; } } W_btn.addEventListener(MouseEvent.CLICK,WInfo_Close); Now, when the movieclips "WTeacher_Info" and "CTeacher_Info" are played the first TIME, they OPEN a box, and when they play a SECOND time, the box closes. Im TRYING to make it so that if one box is open, and the other box's button is clicked, the open box closes FIRST, then the correct box opens. Am I defining my variables wrong?Quote from: EchoLdrWolf316 on December 22, 2008, 02:00:16 PM ACTIONSCRIPT 3.0 I'm not even close to an expert at ActionScript, but try that. HM, not quite, but it's close.I've messed with it, and I think I'm defining the variables wrong. Anyone know how to define a numeric variable?Figured it out: Code: [Select]var C:int = 0; var W:int = 0; //----------------------------------------------------------------------------- function Cinfo(e:MouseEvent):void { if (W == 1){ WTeacher_Info.play(); W = 0; } if (C == 0) { CTeacher_Info.play(); C = 1; } else if (C == 1){ CTeacher_Info.play(); C = 0; } } C_btn.addEventListener(MouseEvent.CLICK, Cinfo); //----------------------------------------------------------------------------- function Winfo(e:MouseEvent):void { if (C == 1){ CTeacher_Info.play(); C = 0; } if (W == 0) { WTeacher_Info.play(); W = 1; } else if (W == 1){ WTeacher_Info.play(); W = 0; } } W_btn.addEventListener(MouseEvent.CLICK, Winfo); //-----------------------------------------------------------------------------Good. |
|
| 1309. |
Solve : Anyone knows what this means?? |
|
Answer» I'm not SURE if this is the right place to post this, but I reallly need some help with a computer issue. I have a video service called Graboid on my computer. Something happened yesterday and I don't know what it was, but now I can't GET on to my Graboid program. I try to click on the window for that program and this is the message I get from my computer: Something happened yesterday Would have been helpful to know what. It may be an clash between VLC and Graboid. Did you know there is a whole Graboid Community out there? This link may help. Good luck. Thank you sooo much! You actually helped me so much more than you probably realize. The moment you mentioned the two different ELEMENTS of Graboid and VLC, which I wasn't completely familiar with, I mentioned this to Tom and he then told me that VLC was a part of the Graboid program. You see I thought it was our video program and didn't remove it along with Graboid when I tried to download it again. So this time I removed both the Graboid and VLC components and then downloaded them again and voila-- I've got Graboid back! Thank you. Thank you. DeannaI'm happy everything worked out. I gotta tell ya, I just love that name Graboid. I have these visions of....oh never mind. Quote from: Sidewinder on December 20, 2008, 06:42:10 PM I have these visions of....oh never mind.LOL |
|
| 1310. |
Solve : Converting RGB to hexadecimal (VB.net)? |
|
Answer» This is the code I have: Application methods and properties that accept a color specification expect that specification to be a number representing an RGB color value. An RGB color value specifies the relative intensity of red, green, and blue to cause a specific color to be displayed. Source: Visual Basic Language Reference I suppose thats what i want... I'm not quite SURE why it wouldn't be. I just wanted to make it so that you can use rgb or hex code to achieve the same, or almost exact same color. My program generates rgb but hex is easier to use(copy and paste numerous times). thanx.oh and also im not sure what method I would use to do this, but using streamwriter im trying to save to a text file, but the text I'm saving needs to have quotes in it. maybe an escape key? or even something simpler?yeah.I don't think that code is right actually. If i use 0,0,0 i just get 0 as a result. if I use 1,1,1 i get 6f. and if I get a hex that looks real, I plug it into something and get a color that way off.Consider the color where the red/green/blue values are decimal numbers: red=36, green=104, blue=160 (a greyish-blue color). The decimal numbers 36, 104 and 160 are equivalent to the hexadecimal numbers 24, 68 and A0 respectively. The hex triplet is obtained by concatenating the 6 hexadecimal digits together, 2468A0 in this example. Note that if any one of the three color values is less than 16 (decimal) or 10 (hex), it must be represented with a leading zero so that the triplet always has exactly six digits. For example, the decimal triplet 4, 8, 16 would be represented by the hex digits 04, 08, 10, forming the hex triplet 040810.so I have to write an if statement to detect whether the hex value is less than 10 and put a zero in front of it? sounds alright. I'll give it a try. thanx.Alright. Thank you dias, i believe I got it to work. But instead of checking the hex I checked the rgb value to be sure it was above 16. Also I still need to know how to output quotes to a file. If anyone could help with that quick. Thanx to all.Quotes are outputted by placing double quotes in your string. For example, this would output a single double-quote: """" As for the hex format; this is a excerpt from my Colour handling class (which I'm in the process of completely rewriting to support more colour models, such as YUV and CIELAB) Code: [Select]Public Property Get WebFormat() As String Attribute WebFormat.VB_Description = "Sets/returns a string representation of this colour." 'retrieve the web format form our R,G and B. Dim I As Long ReDim hexes(1 To 3) As String hexes(1) = Hex$(mvarRGB.Red) hexes(2) = Hex$(mvarRGB.Green) hexes(3) = Hex$(mvarRGB.Blue) For I = 1 To 3 If Len(hexes(I)) = 1 Then 'append a leading zero. hexes(I) = "0" & hexes(I) End If Next I WebFormat = "#" & JoinStr(hexes(), "") End Function 'Joinstr routine. Private Function JoinStr(ByRef Arrjoin() As String, Optional ByVal Delimiter As String = ",") Dim I As Long Dim StrBuild As String 'Strbuild = LBound(Arrjoin) + 1 On Error GoTo getoutofhere For I = LBound(Arrjoin) To UBound(Arrjoin) StrBuild = StrBuild & Delimiter & Arrjoin(I) Next I JoinStr = StrBuild EXIT Function the webformat property Get would need to be changed to a Function, and you might want to remove the leading "#". It outputs the string in a format that will work when PLACED in a HTML attribute such as BGCOLOR or FORECOLOR, etc. Quote from: Sidewinder on December 18, 2008, 04:51:12 AM
WOAH. Hate to call you out there sidewinder- but that is almost completely wrong- although, you simply forgot to bitshift the RGB values. For example: Code: [Select]Hex$(RGB(r,g,b)) which almost works, but we have the same problem with leading zeroes as before...thanks. it works great. everythings working so far. thanks for the help. |
|
| 1311. |
Solve : GBA games? |
|
Answer» Can someone point me to the tools and tutorials i would need to make a GBA game? Also, is this a legal SUBJECT? Thanks.Do you KNOW assembly for the ARM processor? |
|
| 1312. |
Solve : [Delphi/Indy] How to read HTTP Headers after POST? |
|
Answer» Hello, |
|
| 1313. |
Solve : file transfer help !!!? |
|
Answer» Hi brothers!!! copy "jet audio.exe" \\192.168.1.45\shareName\folder In this statment u hav't given the Drive path to copy the file e.g C:\ or D:\ etc and also activate the file that is copied on the Network comptuer Thankx Did you try to use the administrative share? If you use a share name make sure the folder is shared on the remote system. Code: [Select]copy "jet audio.exe" \\192.168.1.45\c$\folder The access denied message can occur if you do not have permissions to the target folder. Does the file access error throw a NUMBER? This can occur if there is a registry error or there is an error with the source file (either the data or the attributes). Try checking the event log on the local machine. Quote In this statment u hav't given the Drive path to copy the file e.g C:\ or D:\ etc When it comes to file paths, you can never provide too much INFORMATION: Code: [Select]copy "drive:\path\jet audio.exe" "\\192.168.1.45\c$\folder" Good luck. Thanks brothers! actually i m working in a computer lab having 50 pc's. So it's some time become very difficult to check every pc for certain software and then install it. That's why i was asking the question. When Ever i try to do this always suffer form error Acess Denied So how to avoide this error? I aslo tried that in VBS Dim fso Const OverwriteExisting = True Set fso = CreateObject("Scripting.FileSystemObject") fso.CopyFile "I:\copy.bat", "\\192.168.1.18\c$\copy.bat", OverwriteExisting but same error!!!!! |
|
| 1314. |
Solve : Oracle login script from Linux to Windows? |
|
Answer» I need to be able to run a CHECK from LINUX to oracle on a Windows server. Im not familiar with Oracle, does someone know what the query statement that can remotely login to oracle on windows is. I wrote something for MYSQL from linux to linux, which sounds similar to what im looking for which is below: |
|
| 1315. |
Solve : How do I disable warning promts when overwirting files with vbscript?? |
|
Answer» I have written a script that extracts the files from a zip file, that dorps into an applications main folder, thus upgrading the folder with new zip file have some same folders . The script works, however when it shows the warning propmt (confirm replace file) Instead of the user having to click (Yes to all) is there a way that I can set that to not appear and the extraction just happen WITHOUT a confirmation prompt. Messages like that can scare users and they may not be paying attention to it and hit cancel then the upgrade wont happen. PLEASE HELP Smiley ' 4: Do not display a progress dialog box. Hope this helps. |
|
| 1316. |
Solve : FILE UPLOAD (VS 2003)? |
|
Answer» HI guys, I have huge web App, one of the functions is to upload FILES, so it works fine, My PROBLEM is, if you try to upload a file that already exist (has the same File name) it will overwrite the one. So what i want is, before the file is saved, check if that name exists, if it does then display (ERROR: the file you are trying to upload, already exist please rename you file or it will over RIGHT the existing one and data will be lost.). My code Private Sub btn_Attach_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Attach.Click If Not in_FileName.PostedFile Is Nothing And in_FileName.PostedFile.ContentLength > 0 Then Dim fn As String = System.IO.Path.GetFileName(in_FileName.PostedFile.FileName) Dim SaveLocation As String = Server.MapPath("Data") & "\" & fn Try in_FileName.PostedFile.SaveAs(SaveLocation) lbl_attachmessage.Text = "The file has been uploaded...!!!" Catch ex As Exception Response.Write("Error:" & ex.Message) End Try Else lbl_attachmessage.Text = "Please select a file to upload...!!!" End If |
|
| 1317. |
Solve : Editing registery in Visual basic 5? |
|
Answer» Hi brothers! |
|
| 1318. |
Solve : Jdbc with MS Access? |
|
Answer» hello is it true that jdbc is not compatible with ms access Not true! MICROSOFT provides an access method called ODBC which Access can understand. Sun provides a bridge from JDBC to ODBC. You can setup either a DSN or DSN-less connection. Check out either this ARTICLE or this one. Good luck. |
|
| 1319. |
Solve : Bare popup HTML? |
|
Answer» I can't seem to find the code to make this: but the code must be contained in the page itself, as the link to the page in in an XML document. What do you mean? Use something like this... Code: [Select]<html> <head> <script type="text/javascript"> function open_win() { window.open("http://www.mysite.com/popup.htm","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=800, height=600"); } </script> </head> <body> <form> <input type="button" VALUE="Open Window" ONCLICK="open_win()"> </form> </body> </html> This would be the page that opens ("popup.htm")... Code: [Select]<html> <head> <title>Popup</title> </head> <body> <OBJECT width="800" height="600"> <param name="movie" value="filename.swf"> <embed src="filename.swf" width="800" height="600"> </embed> </object> </body> Just an example.... Quote from: kpac on November 05, 2008, 02:26:36 PM Code: [Select]{ Is there anyway to include this code into the actual "krhs_tsa.html" page that contains the .swf ? I don't have it set up to be linked from a javascript button. The .swf's html file is linked from inside an XML that another swf reads.Quote from: EchoLdrWolf316 on November 05, 2008, 03:29:58 PM Is there anyway to include this code into the actual "krhs_tsa.html" page that contains the .swf ? I don't have it set up to be linked from a javascript button. The .swf's html file is linked from inside an XML that another swf reads. I don't think so. But if you don't want it to be opened from a button (like a link, maybe), use this: <a href="#" onclick="open_win()">Open Popup[/url] |
|
| 1320. |
Solve : C+ or C++ program? |
|
Answer» Is there such thing out there as a c+ c++ program that GOES threw an teaches you the commands. I have one for basic but it runs on 98 an I want to learn c++There is a Programming board...if that were you think this goes but dont now how to move it.YOu shouldn't have to move it.....you should have known it was a programming question..... |
|
| 1321. |
Solve : foxpro 2.6 in dos...? |
|
Answer» is it possible to CONVERT a system which uses foxpro 2.6 in dos into an ONJECT ORIENTED system?? using vb.net or other PROG lanuaes of the sort? please helpI'm going to go ahead and move this to programming. |
|
| 1322. |
Solve : VB - linking to external flash movie? |
|
Answer» I am building a vb project that has a flash movie embedded into that - that I link to via a URL. I've built this on my Vista machine and it runs fine (tested without internet CONNECTION and no movie loads), I've built this on my Vista machine and it runs fine (tested without internet connection and no movie loads) I have no idea what that means. Without an internet connection and no movie loads, how do you know it works fine? This link may help. Be SURE not to use the default web browser control. Quote from: Sidewinder on November 06, 2008, 04:54:39 AM QuoteI've built this on my Vista machine and it runs fine (tested without internet connection and no movie loads) I knew it worked because without an internet connection it wouldn't display the movie - checking that it's not using a local source. With an internet connection the movie did load. The problem I've since found is that when building the .exe I had to also include the Shockwave Flash Object image holder, along with the other build files (my naivety of VB is showing through!!) Quote The problem I've since found is that when building the .exe I had to also include the Shockwave Flash Object image holder, along with the other build files (my naivety of VB is showing through!!) Best way to learn. You probably won't have that problem again, at least not anytime soon. |
|
| 1324. |
Solve : Program Database Manager Mismatch - Visual C++ 2008 Express? |
|
Answer» I installed Visual C++ 2008 Express in August and everything went fine until yesterday, when I was trying to compile my code it gave the following warning - "cl : COMMAND line warning D9028 : minimal rebuild failure, reverting to NORMAL BUILD" and the error - "fatal error C1902: Program database manager MISMATCH; please check your installation" and I cannot compile it. Please help. |
|
| 1325. |
Solve : Displaying Available Hard Disk Space? |
|
Answer» I admit defeat! I want to display the available space of a hard drive in a text box. Simple! Where is the text box? You can't use console.write to a text box. And you can't have a TEXTBOX in a console application. You code produces output on the console with no problems. (VS2005)Quote from: Sidewinder on November 04, 2008, 02:21:03 PM Where is the text box? You can't use console.write to a text box. And you can't have a textbox in a console application. The code I had was what M$ offered in their help section - I was trying to submit the response to a text box but wasn't sure how to accomplish this. Since found: Dim driveSpace As String driveSpace = (New DriveInfo("C").AvailableFreeSpace / 1024 / 1024) TextBox.Text = driveSpace All done! |
|
| 1326. |
Solve : Required fields in Access database? |
|
Answer» In a previously designed database, I made fields required by setting the Validation Rule to the [first name] field to Is not null and the Validation Text to "Please enter a first name." I didn't want to use Required = Yes because it gives the user a message that is too technical. This method worked just fine. When the user clicked on the command button to close the form, the above messages would pop up if the field was left blank. |
|
| 1327. |
Solve : Simple question :)? |
|
Answer» Hello all , could anybody help me understanding this "The Law of Demeter for functions requires that a method M of an object O may only invoke the methods of the following kinds of objects: 1. O itself 2. M's parameters 3. any objects created/instantiated within M 4. O's direct component objects simple example for each case ( case 1 , 2, 3 and 4 ) would do thank you this paragraph follows the above : "The basic idea is to avoid invoking methods of a member object that is returned by another method. When you do this, you make structural assumptions about the container object that may be likely to change. The container may later need to be modified to contain a different number of the CONTAINED objects, or it may end up being changed to contain another object which contains the original component object. If the "returned" object isn't a subpart of the object whose method was invoked, nor of some other object, then it typically is not a violation of LoD to invoke a method of the returned object (particularly if the object was created by the invoking method)." could you please help me understand this too... your help is highly appreciated WE don't do people's Comp Sci homework for them. IM a math major gradute, doing my master in computer science, this is NOT a homwork..im doing a reseach on the SoC ( seperation of concerns ) and came across LoD (law of demeter ) ..if you dont want to help..thats ok..just dont give me excuses LIKE "we dont do homework' ! plus .think about it! what kind of a silly homework would my question be ! This is not a masters level tutorial site. Read some of the other posts to get an idea of what type of question stands a good chance of being answered. And leave the attitude at the door. David Bock's "paper boy example" SEEMS to be the sort of thing you are looking for however. lol...the question i asked it NOT even A MASTER LEVEL DEAR... i dont wana LEAVE MY ATTITUDE AT THE DOOR...I WANA TAKE IT WITH ME WHEREVER I GO :p DO ME A FAVOR AND "KICK ME" OUT OF THIS FORUM ! IT SUCKS LOL..CANT EVEN ANSWER A SIMPLE QUESTION ! YOU GUYS ARE STUPID... GUESS THIS WILL BE MY LAST MESSAGE HERE..SO LET ME SAY "YOU SUCKKKKK,,:p" NO HARD FEELINGS...EIHHH ?:p///CIAOO...:pWith that attitude, you won't get any help. Quote GUESS THIS WILL BE MY LAST MESSAGE HEREFair enough. I'm sure someone like you can Google. Topic Closed. If the OP or anyone has any inquiries REGARDING this, please PM me or one of the moderators.Being the simple question that it is, I'm sure you'll have no trouble finding the answer yourself. |
|
| 1328. |
Solve : write an assignment statement that performs the following operation: adds 2 to a? |
|
Answer» I'm just starting to learn programming. I understand part of the QUESTION, but I'm not sure when it asks to store the result in b. Can someone help?Welcome to the CH forums. An executable statement that defines or redefines a variable BASED on the result of EXPRESSION evaluation. As a general rule we don't do homework but ... A=A + 2 redefines the variable A to the result of expression evaluation A + 2 Good luck with your studies. I understand you don't like to help with homework, but I'm stuck. I understand everything you just put in your answer. The part I don't understand is when it says to store the result in b. What does that mean? I KNOW how to add 2 to a. Oops, sorry about that, I should have PAID more attention to your post. Have a look at this: b=a + 2 So if the value stored in a is 10 then the value stored in b would be 12 (a + 2). Hope this helps Never mind. I figured it out. The answer is b=2+a. Thanks anyway.Beat you by just one minute. Which language are you studying? It's not a specific language. It's logic and design. I understand most of what I have learned so far, but there is so much different stuff, it stumps me some times. |
|
| 1329. |
Solve : C# Windows App to execute an EXE upon button press? |
|
Answer» Hello, |
|
| 1330. |
Solve : graph explanation? |
|
Answer» Could anybody PLEASE explain FIGURE ONE of the paper in that link : http://www.cs.duke.edu/~jsv/Papers/AgV88.IO.pdf i tried my best to understand it but i just couldnt...PLEASE PLEASE help me out in this... i googled FFT and i know that its :i know that its a fast algorithm ( o(nlogn) to find the DFT ( discrete FOURIER traform) ) where DFT is a way to covert time DOMAIN signal to frequency domain signal. but i just could understand the graph in FIGURE one in the second page right under the FAST FOURIER TRANSFORM YOUR HELP IS MUCHHHH APPRECIATED I'm going to have to read the article up to the point of the graph, and probably a bit past, if I have a hope of understanding. Does not the graph simply illustrate the point they're trying to make?thank you dear, you dont have to read wats before,, trust me . it doesnt help you to understand the graph. im really waiting for your help...cz honeslty i gave up If you are actually doing a CS COURSE why not approach your tutor? Otherwise you could join any of the CS forums (see here) where I'm sure students and post grads would be pleased to give you an immediate response. |
|
| 1331. |
Solve : unix script writing? |
|
Answer» I need help writing this script. Here is the script and my answer. Can SOMEONE help me please. This is my first script. Create an executable script file called “newname” that will perform the followings: 1.Rename a file upon the user’s request. If the file exists, prompt the user for confirmation before renaming the file. The screen should prompt the user for a.“Name of file you want to rename.” Use the “\c” escape character. b.“New name of file” Use the “\c” escape character. c.“File Exist” to AVOID overriding a file. d.“File $oldname changed to $newname” e.“Do you want to rename another file?” If the user selects “yes” the system should refresh the screen and if the user selects “no” the system should exit to the prompt sign. f.Refresh the screen to go back to the menu until the user selects the exit option This is what I wrote rm -i Echo "\c" Read a file to rename If file do not exist Then Echo"\c"Rename the file Otherwise EchoAsk if the user wants to override file EchoRead the user's choice (y/n) If the answer is yes (y) Then Echo"Rename the file" Otherwise EchoDisplay message ("File Exist") Fi Refresh the screen Exit You have made a good START, you have written out the logic of the script. Now you need to research the shell commands and put them in the correct PLACES in your script, then run it and edit it until it does what you want. |
|
| 1332. |
Solve : batch file not running all commands? |
|
Answer» I'm trying to run several COMMANDS in a batch file. However, the first command brings up a new instance of cmd.exe in the same window (fine), then stops there and doesn't run the other commands in the batch file. Is this not possible? To enable delayed variable expansion in a batch file, you can place this line before the applicable section of code Thanks for the reply. Yes, I tried it and the code runs as if enable delayed expansion is not set to 'on'. I tested by OPENING up a cmd window manually and entering the code with the original (cmd /v) line and it works. Then I re-ran the code with the suggested line and noted the results. Then I re-ran it for a third time without either line and I get the same result as if I ran it by setting the value locally(setlocal enabledelayedexpansion). If I use 'cmd /v', is there a way that I can force the next line of code to run instead of having to enter it myself? Sloopy Hmmmm... without actually seeing the code in question, this becomes a bit of a guessing game. Quote from: Dias de verano on October 12, 2008, 11:39:18 AM Hmmmm... without actually seeing the code in question, this becomes a bit of a guessing game. The code calls another program and unfortunately, that is where the problem occurs. I guess for some reason it only works with 'cmd /v' and not 'setlocal enabledelayedexpansion'. I don't have access to the code for the other program, so I'll have to do some more digging to find a work around. Thanks for your help, SloopyHi I also got this same problem with me but still i did'nt get any solution of this please SUGGEST me about this. _______________________________________ ___________ Capture One Auto Transport |
|
| 1333. |
Solve : what are these 2 programs , please? |
|
Answer» DIV X CODEC , it has not been used since 23/4/03 wa update v 3.50 beta2Should that be WPA? If so its a trial version of Wifi Protected Access program, possibly not worth keeping. Go to the "W" section here for a few details. IN THINK I WILL TAKE OUT THE CODEC AND THE OTHER IS WA , NOT IN "W" SECTION HARRYDid a bit more searching and found that WA is probably the Google Web ACCELERATOR which is no longer AVAILABLE. I'd recommend renaming the file then in a couple of weeks, if no "File not found" error message has been displayed, delete it. You could have a look in Add/Remove Programs to see if the Google WA is installed. its not in add/remove the only thing there is google toolbar which i have never used and cannot got rid of it Quote google toolbar which i have never used and cannot got rid of it You might want to look here.. thank you i will go through it and let you know what happens |
|
| 1334. |
Solve : Can i do changes in gpedit.msc with programming? |
|
Answer» Hi dear experts!!! |
|
| 1335. |
Solve : Edit/change DWORD value in Registery with Visual Basic 5? |
|
Answer» Hi DEAR brothers!!! |
|
| 1336. |
Solve : Prevent duplication? |
|
Answer» In an Access database, I have a subform attached to a main form linked by the Service ID. There is a combo box on the subform where the user can select names of adults who received a specific service (the bound column in the combo box is the ADULT ID). Jane Smith, for EXAMPLE, could be chosen more than once PROVIDED that the Service IDs are different. The user shouldn’t be able to enter her name TWICE under the same Service ID. Right now, the user is able to do that. How do I prevent that? |
|
| 1337. |
Solve : How to make .exe file of c program?? |
|
Answer» How to make .exe FILE of C program?what you NEED is a compiler. what OS are we building this on? There are lots of compilers out there.... google |
|
| 1338. |
Solve : Create a key? |
|
Answer» sir Sidewinder, Would you please tell me the way. Would you please tell me the way to convince you to stop creating polls everytime you post? Check out this method. Most of my snippets are for VBScript, but basically you end up with the same results. Why this huge interest in the registry? What are you trying to accomplish? As processor is the brain of computer similarly registery is aslo the brain of OS as u know. Secondly i add pol because u can limitize the days of ur post. that's why i use poll method. Due to this my question will be deleated after 5 days. every one says i ask too much questions, well, asking question is the main step of getting knowledge form a knowledgeable persone; like u Hope u r not anoyed i tried that code; the code was quit difficutl for me because i dont know how u program with "Public" ; i usually use private method to solve my problems. So would u please explain this in easy way. Suppose i want to create a key sys in HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS \ so .............. The whole purpose of the forum is to ask questions. This way we all LEARN together. Don't worry about asking too many. Quote Secondly i add pol because u can limitize the days of ur post. that's why i use poll method. Due to this my question will be deleated after 5 days. Actually, I think the poll is only open for 5 days. The post stays around for eternity. Many people read these POSTS, so the questions and answers are available to help someone else. Quote i tried that code; the code was quit difficutl for me because i dont know how u program with "Public" ; i usually use private method to solve my problems. Private methods (functions and subs) can only be called by other methods in the same class. Public methods can be called from anywhere in your program. The Windows registry is a hierarchical database. In order to access the registry in VB, it's necessary to call the Windows API. To do this you must first define which Windows library to use (advapi32.dll) and which functions to use (RegCreateKeyExA and RegCloseKey). That's what the private declare functions do. When Microsoft wrote the library, they defined values that need to be passed to the function for it to work. The constants you see define those values. After all the smoke has settled, all you need to PROVIDE is the key name and the hive name. The hive names are defined in this section of the code: Code: [Select]Const HKEY_CLASSES_ROOT = &H80000000 Const HKEY_CURRENT_USER = &H80000001 Const HKEY_LOCAL_MACHINE = &H80000002 Const HKEY_USERS = &H80000003 The key name you provide. See the example in the code. Good luck. Note: Either take a restore point or create private keys in the hkey_current_user hive. As you mentioned, the registry may be the brain of the OS, but it has been known to flat line from time to time.i tried the method. the method is quit difficult and hard to understand because "Public" function is used. if u expalin in with "Private" then it will easy for me. suppose HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSI ON\"system" is the key i want to create, what would be the code but adding DWORD VALUE and string value we dont useing functions as HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSI ON\RUN\OPTIONAL COMPONENTS\IMAIL, 1, "REG_DWORD" AND AND AND Dim Reg As Object Set Reg = CreateObject("wscript.shell") ' Suppose Write App to Startup with Computer Reg.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\ CURRENTVERSION\RUN\" & App.EXEName, App.Path & "\" & App.EXEName & ".exe" SIMILARLY CAN WE USE PRIVATE METHOD TO CREATE A SUB KEY IN REGISTERY In your other post, I gave you a VBScript solution, which you said was fine. I took it to mean that you created a script object reference in your VB program, compiled the program and it ran successfully. This time I posted a VB5 solution. Did you put the code into a console application? Did you compile it? Did it run? Please post the portion of the code you're having trouble with. There is only one public function in the code. There are no classes, so if you prefer to make it private, go ahead. Are you trying to learn VB or do you only want to change the registry? If it's the latter, you can do it from the command prompt with reg Ya i tried that code. i put the code same to same in the Visual basic and done some change in that portion of code where to give the name to the key. i compiled that, not error occured. but The key was not created. so dont know what happened........ So what should i do I tried to simplify the API call as best I could. Code: [Select]MODULE Program Const HKEY_LOCAL_MACHINE = &H80000002 Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long Private Declare Function RegCloseKey Lib "advapi32.dll" Alias "RegCloseKey" (ByVal hKey As Long) As Long Sub Main() Dim rc as Long RegCreateKey(HKEY_LOCAL_MACHINE, "Your Key Goes Here", rc) RegCloseKey(rc) End Sub End Module What are you trying to do? A skilled programmer wouldn't need to ask on a forum about the registry and API calls. If you are not skilled, you should not be mucking around in the registry. One misplaced API call can severely cripple your machine. Check out this site to see all the functions in the advapi32 library. Not as friendly, but still useful also read MSDN Good luck. I no longer need to bother with the actual API functions and can rather use the class module I made that wraps them! HA HA HA! but I found that too inflexible, so I created an entire library devoted to saving a programs settings. I have yet to use that library at all... the MSDN is great- especially when you pair it with APIViewer 2004, which contains a lot of API declarations not found in the pitiful APILOAD.EXE included with VB.Done it. Yahooooooooooooooooooooo . THankx Brothers. According to my observation Adding DWORD value or a file in register is easy but creating a key is a difficult thing. |
|
| 1339. |
Solve : visual basics? |
|
Answer» HEY anyone know how to work visual basic 2008 contact me if you do and ill explain my PROBLEM thanksPost your problem here on the FORUM, and if anyone FEELS like HELPING, they will. |
|
| 1340. |
Solve : Program for math? |
|
Answer» During the 1960s I wrote programs in FORTRAN but I have not been into computers since. I have an E Machine running Windows Vista. Is there a program I can run on this computer that will do math. What I have in mind is: Of course what I have in mind is more complicated but you get the idea. How more complicated? There are numerous calculators available as installed Windows programs, Powertoys, or Widgets that are reasonably sophisticated. Or are you looking for SOMETHING to, say, to solve quadratic equations using discriminants or perhaps solve for the integral coefficients of a polynomial? More details needed. If you still have that '60s era program or you're just interested, you might find some references for Fortran hereNo I do not have any Fortran programs left. Those programs were written to do certain things for the company I worked for. What I have in mind now is not too complicated but just for my fun. Thanks for your suggestions. That is just what I wanted. Surely I can find help with what you have given me.you mean??? looking for the program that perform those calculation?Yes I want a very simple program that I can USE while running Windows Vista. I am not smart enough to know what I can do with Vista. Maybe what I need is a hand HELD computer but I wanted the answers printed out. Thanks |
|
| 1341. |
Solve : Modifying a Registry value using C++? |
|
Answer» Could ANYBODY PLEASE TELL me how to modify a REG_SZ registry value with Visual C++ 2008. |
|
| 1342. |
Solve : C++ issue with file I/O? |
|
Answer» Hey guys, |
|
| 1343. |
Solve : JAVA COMPILER? |
|
Answer» Ok so I wanna download a java COMPILER so I can start praticing JAVA. Ok now I went to the sun site to get their JDK compiler and I MEAN I downloaded it and a file poped up and I clicked it and it downloaded but I dont see a compiler ANYWHERE. Whats the BEST compiler for java codes and where do you get it. If you downloaded the Java JDK, the compiler will be in the bin directory LABELED javac.exe |
|
| 1344. |
Solve : Visual Basic Code Required? |
|
Answer» Hi dear Experts!!! i think if statment will The solution is not for beginners. It will use loops, API declarations, and callbacks. the If statement usage goes without saying.Yes u r rite. Can i have the source code of it please. want to end abc.exe running in memory. it will take some time I will try and then tell u what happened......... |
|
| 1345. |
Solve : Opening a file? |
|
Answer» i want to create a .exe file in vb that when i CLICK on that file so what do u say about this. If u give me the code and explain it also, it would be easy for me. Would it now? If you post your code, someone here may be able to point out why you got the result you did, and perhaps suggest how to get the result you're looking for, otherwise we're all stumbling AROUND in the dark. Oh! it worked. I made some change in it and it worked................. hurrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrryyyy yyyyyyyyyyyyyyyy |
|
| 1346. |
Solve : popup menu help!!! how to make it in php???? |
|
Answer» GOOD day guys! im new in php and im CURRENTLY making a page. i want to make a popup menu.. how do i make it? EX. 1(as main menu) and a,b,c,d... (as sub menus) i rili need help guys... thnks in advance!.So, you're referring to a drop-down menu...correct? Your best BET is a CSS based menu. VISIT here: http://www.dynamicdrive.com/dynamicindex1/indexb.html |
|
| 1347. |
Solve : Start programming?? |
|
Answer» HEY I was wondering....what is the best language to start programming in? Thanks I'd have to say to start programming, like from the very beginning would probably have to be an OBJECT based language. Something like Visual Basic Easy to get the hang of but not very powerful. Get used to programming language, syntax etc. then move onto something more adventurous. FBQuote from: fireballs on October 15, 2008, 03:37:34 AM Something like Visual Basic Easy to get the hang of but not very powerful. How so not very powerful? not powerful in the sense that it's pretty limited, relative to say C++ FBim 14 and started teaching myself c++ with books. i have no PROBLEM learning it and understanding the code and how it works but it takes me a longer TIME to learn it. Quote from: fireballs on October 15, 2008, 06:17:41 AM not powerful in the sense that it's pretty limited, relative to say C++ Anything you can do in C/C++, you can do in Visual Basic. Don't get me wrong, it could be a pain in the *censored* or more trouble then it's worth- but it can be done. |
|
| 1348. |
Solve : How to copy a portion of a string of text? XP cmd file? |
|
Answer» HELLO, I have a command file that I'm trying to select a part of a string. Let say I have WindowsXP-KB123456-X86.exe. I WANT to copy just the KB123456 and shove it into a variable to be used later. I have been poking around the net with no luck. Any suggestions? Kage_To slice a string USE the following syntax:- set substring=%wholestring:~X,Y% where X and Y are numbers. X is the offset from the start -- 0 (ZERO) is the first character -- and Y is the number of characters to take. so if bigstring=Australia %bigstring:~0,4% is Aust and %bigstring:~2,5% is ustraVery nice! I love it when there's a nice simple answer to questions. This works great... Thanks....I was off by 1 in my second example string slice. ustra is 1,5 not 2,5. Please see modified below Quote from: Dias de verano on October 17, 2008, 03:58:40 PM so if bigstring=AustraliaThanks for the correction. I was able to understand what it was doing. It's now in my cmd file and has saved me a lot of lines of redundant CODE. |
|
| 1349. |
Solve : structs inside of structs? |
|
Answer» im a new programmer learning c++. right now im trying to teach myself c++ by programming little GAMES. im and trying to have the USER pick a space from the board(using multidimensional array representing a country) and from there open up another multidimensional array displaying a playing field. each space on the playing field will hold two numbers representing men and horses. |
|
| 1350. |
Solve : VBScript objects and methods? |
|
Answer» Hi Friends, |
|