

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.
651. |
Solve : Please help me!!!? |
Answer» Hello, how are all of you? |
|
652. |
Solve : Batch popup message? |
Answer» Is there anyway to popup a message with a batch script where the user has to click OK for the batch file to run? |
|
653. |
Solve : System varibles? |
Answer» Hello I WANT to WRITE a script for windows to edit the SYSTEM variables. Does anyone knowed how can I get to the Windows system variable?? Tnks DavidThis might help. Note: MYVAR is just arbitrary name I made up. Dim WshShell, WshEnv Set WshShell = WScript.CreateObject("WScript.Shell") Set WshEnv = WshShell.Environment("SYSTEM") To set the MYVAR variable use: WshEnv("MYVAR") = "Any Value" To remove the MYVAR variable use: WshEnv.Remove "MYVAR" If you use the SET command from the command line, you will get a list of all variables defined in the environment. If you need new ONES, just make one up and change MYVAR accordingly. Any changes/additions made, only last as long as the user session. Hope this helps. |
|
654. |
Solve : Runtime Error 3011 in VB 6.0? |
Answer» Hi there, |
|
655. |
Solve : help required? |
Answer» I want to create a batch file or somethink similar which when run will ask for the computer name then open a file on that computer. |
|
656. |
Solve : Math.Sqrt() problem.? |
Answer» Im USING C++ Visual Studios 2005 express edition. |
|
657. |
Solve : programs to use for programming Java? |
Answer» COULD someone PLEASE tell me some good PROGRAMS to use for programming in Java other than Ready to Program or Blue J? Also, I'm trying to install Ready To Program and it ALWAYS stops at 27 percent when i run the setup and says "Extraction FAILURE: return from extract=-9". Can someone possibly tell me why this is happening? Thanks.Everything from editors to IDE: http://www.freebyte.com/programming/#java Hope this HELPS. |
|
658. |
Solve : Problem with bat2exe.com? |
Answer» hi, |
|
659. |
Solve : simple Excel filter-function? |
Answer» I suppose this isnt really PROGRAMMING PUT it's the nearest topic. |
|
660. |
Solve : C++ Builder 6 - Send Mail? |
Answer» Hi, |
|
661. |
Solve : Gateway logo? |
Answer» How do I get RID of the "Gateway" logo that appears as my computer boots? I would really like to PUT something eles there if I knew how. Suprisingly I found a lot of websites for CHANGING your logo. |
|
662. |
Solve : Visual Basic .NET? |
Answer» I've just finished mastering DOS commands and programming to the point where I make commands appear at will. Now, I want to further my education of programming with Visual Basic, to learn the ropes. HOWEVER, I STARTED with Visual Basic .NET 2003, and all the books I have assume I know Visual Basic 6.0! Where can I go to learn the basic fundamentals uf programming? (Currently, most of the book's code looks like gibberish.)I'm not sure that anybody masters the CMD processor commands, ESPECIALLY since it changes with every version of Windows. Be that as it may, VBScript might be good next step. Scripting offers objects, methods and properties but still maintains a text file environment run under an INTERPRETER as opposed to full scale compiling and linking. |
|
663. |
Solve : Back ground script really cool? |
Answer» Hello |
|
664. |
Solve : Batch File For Complex Date Calculations? |
Answer» Hi, function getDateOfLastWeekday(weekday){ Thanks for you help. I know very basic batch commands but nothing of this level. ExistanceOh yeah sorry this is the usage info on that Jscript i pasted the code for above in my first post: Quote // It takes an integer between 0 and 6 as an argument (above 6 is accepted but might give incorrect results). Existanceyou can just run the javascript using cscript/wscript..no need to convert to batch...Thanks for your suggestion ghostdog74...i'm glad that someone replied. I currently run the jscript by itself but i would much prefer to make into a standalone batch file. The main reason is that jscript seems to run straight through its commands without waiting for any process or command to finish first, unlike a batch file where you can make it wait properly and then proceed or retry depending upon the outcome. Does anyone know how to call the date in "any" of the ways i need to call it? Even a nudge in the right direction is better than nothing... Thanks in advance, ExistanceI don't even think that the ancient LANGUAGE of BATCH is designed to do domething that complex. I'm thinking of a few ideas, but it wouldn't be able to do cross-month calculations and there's no way it could know which month has 30, 31 days, etc.. It'd just be foolin around with the "ECHO %date%" command. Wait just a minute... it might work...here's my line of thinking... maybe it CAN be done... I'm going to try an example that sets back a week from the current date... This would require a lot of calculating, and knowledge of the number of days in a month; there's no algorithm in BATCH (*censored*, that's the second time I accidentally typed "BATVH"...) to do that. So... here I go on this... The output of "ECHO %date%" sans the quote marks is similar to the following: Wed 07/05/2006 Dredging up my DOS tutorial, you can take only part of that with the "~" command and save it as a variable. Remembering that the "W" is character 0 on the line, you could set x as the day with the following: SET /A x=%date:~7,2% That would start at character 7 and end 2 characters later. Then, x would be the number 05. Then, you could do this: SET /A day=%x% - 7 NOTE: This only works on later operating systems. Test the /A switch by typing at a command prompt (minus the quotes): "SET /A x=7 - 2" and pressing [Enter]. If you get an error, my method won't work. If you see the number "2" then another prompt, it works and so will my method... I think. to go back a week. This can cause negative numbers, but you can use that to your advantage. Use this to get the month: IF %day% LEQ 0 SET /A month=%date:~4,2% - 1 IF %day% GEQ 1 SET /A month=%date:~4,2% This says: "If the value of variable "day" is less than or equal to 0, set month as two numbers starting at the 4th character in the date minus 1. If this value is equal to or greater than 1, just take the two characters with no subtraction." Then go through the process of doing this (I'm abbreviating the excruciating list): IF "%month%"=="0" SET month=Dec IF "%month%"=="01" SET month=Jan IF "%month%"=="02" SET month=Feb IF "%month%"=="03" SET month=Mar IF "%month%"=="04" SET month=Apr ... IF "%month%"=="12" SET month=Dec Yeah, you get to do all 13. This sets up your month. But what about the negative day (if you have it)? Well, this is where I'm trying to work this out. It seems possible up to this point, but I'm getting odd errors from DOS testing this part of the code. I'll need to get back to you on this... unless you say "never mind". This is so big, it may be my biggest challenge yet. EDTED: I think I got it, but it will require a lot more work. Let me keep going on this, I'll keep you posted! Except that I need to run out to Wal-Mart in about half an hour, so you may need to wait for the rest of this.OK. Now you'll need to use precisely the code below. It will direct the batch file to go to the subroutine that corresponds with the month: Code: [Select]GOTO %month% :Jan IF "%day%"=="0" set day=31 IF "%day%"=="-1" set day=30 IF "%day%"=="-2" set day=29 IF "%day%"=="-3" set day=28 IF "%day%"=="-4" set day=27 IF "%day%"=="-5" set day=26 IF "%day%"=="-6" set day=25 GOTO AfterDayChange :Feb IF "%day%"=="0" set day=28 IF "%day%"=="-1" set day=27 IF "%day%"=="-2" set day=26 IF "%day%"=="-3" set day=25 IF "%day%"=="-4" set day=24 IF "%day%"=="-5" set day=23 IF "%day%"=="-6" set day=22 GOTO AfterDayChange :Mar IF "%day%"=="0" set day=31 IF "%day%"=="-1" set day=30 IF "%day%"=="-2" set day=29 IF "%day%"=="-3" set day=28 IF "%day%"=="-4" set day=27 IF "%day%"=="-5" set day=26 IF "%day%"=="-6" set day=25 GOTO AfterDayChange :Apr IF "%day%"=="0" set day=30 IF "%day%"=="-1" set day=29 IF "%day%"=="-2" set day=28 IF "%day%"=="-3" set day=27 IF "%day%"=="-4" set day=26 IF "%day%"=="-5" set day=25 IF "%day%"=="-6" set day=24 GOTO AfterDayChange :May IF "%day%"=="0" set day=31 IF "%day%"=="-1" set day=30 IF "%day%"=="-2" set day=29 IF "%day%"=="-3" set day=28 IF "%day%"=="-4" set day=27 IF "%day%"=="-5" set day=26 IF "%day%"=="-6" set day=25 GOTO AfterDayChange :Jun IF "%day%"=="0" set day=30 IF "%day%"=="-1" set day=29 IF "%day%"=="-2" set day=28 IF "%day%"=="-3" set day=27 IF "%day%"=="-4" set day=26 IF "%day%"=="-5" set day=25 IF "%day%"=="-6" set day=24 GOTO AfterDayChange :Jul IF "%day%"=="0" set day=31 IF "%day%"=="-1" set day=30 IF "%day%"=="-2" set day=29 IF "%day%"=="-3" set day=28 IF "%day%"=="-4" set day=27 IF "%day%"=="-5" set day=26 IF "%day%"=="-6" set day=25 GOTO AfterDayChange :Aug IF "%day%"=="0" set day=31 IF "%day%"=="-1" set day=30 IF "%day%"=="-2" set day=29 IF "%day%"=="-3" set day=28 IF "%day%"=="-4" set day=27 IF "%day%"=="-5" set day=26 IF "%day%"=="-6" set day=25 GOTO AfterDayChange :Sep IF "%day%"=="0" set day=30 IF "%day%"=="-1" set day=29 IF "%day%"=="-2" set day=28 IF "%day%"=="-3" set day=27 IF "%day%"=="-4" set day=26 IF "%day%"=="-5" set day=25 IF "%day%"=="-6" set day=24 GOTO AfterDayChange :Oct IF "%day%"=="0" set day=31 IF "%day%"=="-1" set day=30 IF "%day%"=="-2" set day=29 IF "%day%"=="-3" set day=28 IF "%day%"=="-4" set day=27 IF "%day%"=="-5" set day=26 IF "%day%"=="-6" set day=25 GOTO AfterDayChange :Nov IF "%day%"=="0" set day=30 IF "%day%"=="-1" set day=29 IF "%day%"=="-2" set day=28 IF "%day%"=="-3" set day=27 IF "%day%"=="-4" set day=26 IF "%day%"=="-5" set day=25 IF "%day%"=="-6" set day=24 GOTO AfterDayChange :Dec IF "%day%"=="0" set day=31 IF "%day%"=="-1" set day=30 IF "%day%"=="-2" set day=29 IF "%day%"=="-3" set day=28 IF "%day%"=="-4" set day=27 IF "%day%"=="-5" set day=26 IF "%day%"=="-6" set day=25 GOTO AfterDayChange :AfterDayChange Two things should be noted: One. This doesn't account for the LEAP year. My response: Shut up. I really don't care at this point. The other is that it was intentional that Jul and Aug have 31 days. This is a blinding flash of the obvious, but I've had people argue that that is impossible. Now, we have the month and day of a week ago. The year is easily gotten: SET year=%date:~10% Finally, at the bottom, you can do this: ECHO A week ago, it was day %day% of %month%, %year%. One final note: I haven't figured out a way to make this work cross-years. Just don't run it between January 1 and January 7 and you'll be fine. EDIT AGAIN: Hold on, I'm not getting a good month result. Let me debug this... ...got it. Piece of cake.Turns out, I made a human error: I forgot to fill in the other months! *smacks forehead* Attached is a zipped version of the completed sample you just read. Extract to C:\, then go to the command prompt, type "cd \" bar the quotes, then type "one_week_ago" minus the quotes to see the results of my work. Open the batch file in Notepad to view the source. It isn't exactly what you asked for, but it does show how it is possible (although hard) to do something like this. *pats self on back* EDIT AGAIN: Hold it, another fatal error noticed. Give me a minute... EDIT ONE LAST TIME: Fixed.Thanks for all the work you have done Dilbert. It's much appreciated. I tested the script and it came back with :A week ago, it was day 31 of May, 2006." I'm in Australia so the date today is Thursday 06/07/2006. I think a little reworking of the batch file would FIX that though. But at least now i can see how it is done. I wasn't aware it was so hard to get a batch file to do what i wanted. What is even harder is that i had hoped to display the date not in terms of from "X" days ago but from say the last "Tuesday" or "Monday" (or other days) from within the last week, displayed in the format DDMMYY (or others) and used within a command to get a file like: http://www/somesite.com/file"date_of_last_past_Monday".wmv etc. I'm thinking i might have been a little unrealistic to expect to achieve this with just a batch file. The work that would be involved just to do that (including with leap years) is just unbelievable. I would assume you would have to calculate the date say from 1-6 days ago individually, then associate that with the day name (like Monday, Tuesday etc) which fell on that date, then figure out a way to get the format i need (DDMMYY or MMDDYY or DDMMYYYY etc).....WOW. Erm.... What do you think? Am i expecting too much to be able to achieve all this from a humble little batch file? ExistanceQuote Thanks for all the work you have done Dilbert. It's much appreciated. Does May not have 31 days? Or is it different in Australia? I'm in the USA so I have no idea. But, in the USA, on the 7th of any day, going back 7 days would bring the day counter to "0", so it would roll back to the previous month, or June. June has 30 days, so a day value of "0" would be reset to the last June day possible, or "June 30". By my calender, it is the 5th of July, and the result on my PC is the following: Quote A week ago, it was day 28 of Jun, 2006. According to the standard USA calendar, this would be a correct answer and the file is functioning as intended. Again, if our calenders are different (Like I said, it's 7/5/2006 here, though it'll be 7/6/2006 in 2 hours), that would explain it. IF they're not different, something went wrong somewhere between finishing debugging and the final upload. And not much happened between those two points in time. BATCH is extremely limited; it's an antique method of "programming". If I knew how, I'd use scripts for everything instead of BATCH. But I'll need to learn the stuff, then I'll have to get Norton to accept my VBS files, etc... it's a project for later. I'm not 100% sure I understand what you want. Just so I don't run off making a seemingly impossible batch file you don't need (that was 4 KB -- pretty large for a BATCH), Let me see if I get what you're saying: 1. User inputs a day of the week, such as "Tuesday". 2. Display all files in the current directory that were made this week, from that date to today. 3. Do something with these files. If that's what you're looking for, the job will be considerably easier than you'd think. It would be a simple matter of a few commands interpereted the correct way, then a simple DIR based on those parameters will be simple enough to show it, then any commands after that are coder's discretion. The reason that the batch file you just saw was so darn complicated is evidence that BATCH is very limited: DOS has no real way of sobtracting dates. It isn't intelligent in that way. It just remembers the date in that format, and refreshes it every 24 hours. The BATCH file I wrote isn't as complicated as those files can get; the main reason it's so large is because it needs to send an innocent number through the wringer, as my code interperets that number to get the month and day of 7 days ago -- no small feat in DOS.if your only concern is Quote "jscript seems to run straight through its commands without waiting for any process or command to finish first"i am sure jscript has some timer functions to stop for a period of time before processing continues right? why not use that...? |
|
665. |
Solve : return value of select statement ASP.net? |
Answer» Hi |
|
666. |
Solve : LPT addressing? |
Answer» i WANT to take logic signals from LPT any ONE can tell me how i can ADDRESSING LPT by visual basic 6............. |
|
667. |
Solve : Can Not Copy? |
Answer» Started to LOAD WIIN me and after awhile got this can not copy message SV0325 or Su0325 Any IDEAS how to repair that problem.This article may HELP: |
|
668. |
Solve : I need information about JAVA? |
Answer» Hello everyone and how are all of you? |
|
669. |
Solve : Select Row Problem with DataGrid. (C#)? |
Answer» Hi, |
|
670. |
Solve : Swapable Drive? |
Answer» Got a laptop with swapable drive,I have to boot from a floopy untill it read put in disk or cdrom unit.The yhing is when i put cdrom unit in,it will sound like its working but noyhing happens,WHATS wrong?What OS and does the laptop have a hard drive?Will i got the puter to read the cd but now it say it has a 64K cluster setup partion.Scandisk does not work on disk with the cluster size. So how do i fix that?Im trying to install Win me it had XP im replacing it with what i have in all my puters.Will i got the puter to read the cd but now it say it has a 64K cluster setup partion.Scandisk does not work on disk with the cluster size.Any ideasI have a Dell 3200 Laptop I had win xp took it out to install win me. Will i got the puter to read the cd but now it say it has a 64K cluster setup partion.Scandisk does not work on disk with the cluster size. So how do i fix that?Any ideas.When it say do i wish to enable LARGE disk support y or n what should i say.Now here is the answer to your ?on how large the partion isPartion |
|
671. |
Solve : .bat file help needed? |
Answer» I work for a company where users do not read or indeed follow any instructions they are given. |
|
672. |
Solve : Batch command to refresh desktop? |
Answer» I have created a batch command that RUNS everytime a user signs up in a terminal server, it maps DRIVES and calls an HTML file. The problem I am having is that once the batch file ends, the icons on the desktop are not being refreshed, the user has to manually press F5. Is there a way to refresh the desktop with a command rather than having the user press F5? |
|
673. |
Solve : saving music? |
Answer» hi guys |
|
674. |
Solve : Send email VIA a Vb Script? |
Answer» Does anyone know of a WAY to send a email with an Attachment to a Email account using VBScript and or batch file?? PS. There is a special place in *censored* for spammers. lmao...I sure hope there is... What USE would sending a batch file be for ANYTHING other than spamming?I use a script to backup a number of machines. I have each script send an email to my address with the job log attached. That way I can check all the machines without actually having to VISIT them. tricky tricky tricky.... I am amazed...lolThanks sidewinder. I am not using it to spam people what I want to is AUTOMATE a backup of my pc to my gmail account. |
|
675. |
Solve : Reading Hard Disk Info in VB? |
Answer» I want to read the drive specifications like make, model, etc. of the Hard Disk Drive using a Visual Basic program. PLEASE help.That seems like reinventing the wheel. What are you trying to accomplish?Quote That seems like reinventing the wheel. What are you trying to accomplish?I want to know the VB code to read the IDE header information from the hard disk drive. Which library to USE? What is the syntax of the call? What is return structure? If standard libraries do not support such a call, I want to know how to include an Assembler routine inside a VB program (I know the ASM code to read the IDE header, but I do not know how to add ASM code in VB).Try using the W32_DiskDrive WMI class. Check your COM objects, you may have to include a reference. Quote I know the ASM code to read the IDE header, but I do not know how to add ASM code in VB Might be easier to assemble your ASM module and make the call from your VB program. The linker should make all this possible. It's easier to combine object modules than source modules. 8-) Quote Might be easier to assemble your ASM module and make the call from your VB program. The linker should make all this possible. It's easier to combine object modules than source modules.I wish I understood what you just said... :-/I've tried getting HDD info (mainly free space) via. VB. The techniques I found often produce unpredictable results (telling me I have less free space then I actually do!!!). PS - I don't have a clue either.... ASM called via VB?hello!! even i want to obtain the hard disk serial number, controller REVISION number, hard disk model number, etc with the help of my program. i am writing the code in VC++. i USED the WMI classes in my code but they dont work for window9X. can u please send me a copy of the code which is in Assembly language. i will see if it can help me. my email id is [emailprotected] will u please mail me a copy of the assembly code? thank u.. Quote Might be easier to assemble your ASM module and make the call from your VB program. The linker should make all this possible. It's easier to combine object modules than source modules. Rob that ment write a DLL in ASM , and then add said DLL to your VB Code and call it to get the answer. I could also have meant Eat a Cheeze Sandwich, but i dont like Cheeze |
|
676. |
Solve : Number of transaction in Btrieve? |
Answer» Hi! |
|
677. |
Solve : whats the difference between Visual C++ and C++? |
Answer» whats the difference between Visual C++ and C++?? |
|
678. |
Solve : Print from DOS using HP PCL? |
Answer» I want to RUN my Clipper programs on a stand alone PC using Win 2000 and be ABLE to print using HP PCL. The printer on this system is a HP 720c. My programs process OKAY but I can't get any output to the printer. The printer is the default printer and is CONNECTED via a parallel port. |
|
679. |
Solve : Dark Basic? |
Answer» Just wondering cos, I have just started using it, and think it is a great program!!!Ive Played with it a bit, its Fun and Easy to use , but not very Power FullWhat programming language do you think is powerful and fun?(ish)??Never heard of it until you brought it up. Seems geared toward gaming apps. What programming language do you think is powerful and fun?(ish)?? All the programming languages are fairly powerful, so I guess it depends on what your idea of fun is. Quote All the programming languages are fairly powerfulI was going to say, "What, even Logo?" but then I discovered that you can actually do more with it than draw houses... www.blitzbasic.comMy idwea of fun would be a language that is easy to learn and uncomplicated!! And it has a large variety of different things you can do with it!www.blitzbasic.com !!Yes, but did you see this: Important! MaxGUI is a plugin module for BlitzMax and as such you MUST own BlitzMax. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!You never Stated that you wanted one that was Free. Any way, if you want to do ANT Real Programing Use C++, and if you need Graphics , Download The directX SDK , or The OpenGl SDK Its nither Simple or Easy to Learn, But that is my Idea Of Fun The only thing I've ever written in DarkBasic was Reaction Timer For Windows (http://www.reaction-timer.co.nr/). Not the best display of the power of DB, but it is a very easy to use language. As for C++, I still haven't got round to giving it a bash.... Any good tutorials???http://www.cprogramming.com/tutorial.html This SITES got a copule But once you have the Basics , the rest is not to your own imagination, patients, and enduranceBlitz Basic is EASIER to learn than c++ and is designed to make 2d or 3d graphical games. It might not be as powerful as C++ but commercial games can - and have - been created in this language. If you're not into making games, you can still use it to make some basic "console" PROGRAMS to improve your general programming skills... depends what you want to do. You can get the demo free for 30 days or 30 uses I can't remember. The demo didn't use to have a time limit (although you cannot compile into .exe files of course with the demo) which is the one I use never heard of it im learning c++ |
|
680. |
Solve : Lobotomized ROM? |
Answer» I TRIED to recover Windows 98 on an old Toshiba 7202 - the error message said corrupt or missing himem.sys and a couple other toshiba specific files. I bought a recovery disc on-line and followed the instruction --- "format /s c:\" . know it only loads DOS and nothing ELSE. |
|
681. |
Solve : Batch job sends email if file contains data??? |
Answer» The following BATCH FILE works (with the real email addresses). I need to have it instead of check if there is a file named open_dt_events.txt, check to see if there is data in the file...the file is always GENERATED, I only need to send the email when there is data in the file. |
|
682. |
Solve : WMPLAYER? |
Answer» Is it possible to use MPLAYER inside a QBASIC application? |
|
683. |
Solve : mIRC remote connection script? |
Answer» I'm trying to setup different mIRC remote connection sripts, so I can make one FILE for each network that connects to different channels. |
|
684. |
Solve : Access to the path containing 'hash.web' denied? |
Answer» HI |
|
685. |
Solve : where to do programs? |
Answer» i know java and im learning c++.but i dont know where to write the script so i could do programs.help me |
|
686. |
Solve : Logo Programming? |
Answer» [size=48]LOGO PROGRAMMING!![/size] |
|
687. |
Solve : Binprn.32.dll will not register? |
Answer» Here is the situation I have a program for managing snooker hall lights for billing and accounting, it was running on win98 2nd edition, the COMPUTER crashed after many years. I managed to make an image of the hard drive, and retrieved the folder with the program in it, reinstalled win98 2nd edition, on another comp, and dropped the folder into C: Drive, I got the prog running, installing all the MISSING files/dll it required. The way the program works is when you flick on a table light on, the program starts billing that table, at the END of each shift you used to be able to PRINT all the table totals, this is were my problem is, I cant register binprn32.dll, in the error log it reports it can’t find this dll. I have tried registering it manually using “regsvr32” and with a dll register tool but it still failed, the program is doing everything else but printing, when you attempt to print the printer flashes, so I think the info is getting there. |
|
688. |
Solve : Dir function in a bath file?!? |
Answer» Hi, |
|
689. |
Solve : disabling "ACTIVE" for streaming video???.....? |
Answer» Hello.... |
|
690. |
Solve : SQL problems? |
Answer» ok, ive got My SQL SERVER 2005, ive installed it to my programs list |
|
691. |
Solve : web result as input to C? |
Answer» Right now our thinking is to have a webpage for client to input data, and send the data back to the server, which is using linux. |
|
692. |
Solve : adding a beep to a shell script? |
Answer» ???I cant find text on creating a beep command. |
|
693. |
Solve : i need a roulette script in PHP? |
Answer» i need ONE with the ODDS of winning. Are you able to program in PHP yourself? If you make a start on the script, I can offer suggestions. Do you simply want a function that returns the number and the colour? Or one that handles lpacing bets, etc? one that returns the number and colour like red 36 or black35 Okay, well that's a pretty straightforward script. Can you answer my first question?Quote Okay, well that's a pretty straightforward script. Can you answer my first question? a little bitTo be honest, this is such a simple problem that I'll just write the whole script. Here is a function, roulette() that will return an array(number, colour) that you can then use in your script. I include an example of the use of the function. Code: [Select]<?php functionroulette($twozeroes=false) { //NBTheparameter"twozeroes"isoptional.Itdefaultsto //false,meaningweareusingasinglezero(European) //roulettewheel.Callingthefunction,roulette();isthe //sameascalling,roulette(false);.Foratwozerogame, //CALL,roulette(true); //ForPHPversionspriorto4.2.0,uncommentthenextline: //mt_srand(crc32(microtime())); $number=rand(($twozeroes?-1:0),36); if($number>0) { $colour=(($number%2)==1?'red':'black'); }else{ $colour='green'; if($number==-1) { $number='00'; } } returnarray('number'=>$number, 'colour'=>$colour); }//Endoffunctionroulette() //Exampleofhowyoumightuseit: $results=roulette(); ?> <p> You spun the wheel, and here's what you get: <font style='font-size: 25px; font-weight: bold; color:<?phpecho$results['colour'];?>;'> <?phpecho$results['number'];?> </font> </p> Any questions? For the time being, you can see this script working, >here<. It will be replaced at some point with whatever other problem I'm working on at the time. Thanks mate |
|
694. |
Solve : restore settings? |
Answer» ok is there a way to make a program that will restore your internet settings back to default? like could you do it in C++ or vbscript or something?? |
|
695. |
Solve : Errors That Make No Sense? |
Answer» Class.hpp: |
|
696. |
Solve : Microsoft Access: Code for list boxes? |
Answer» I'm using a list BOX to open queries. It is working just fine but now I need to add reports. How do I adapt the following code to accommodate queries and reports? Thanks, in ADVANCE, for any help. |
|
697. |
Solve : auto start? |
Answer» how would i get a batch file to start when a user LOGS in??Try opening the startup folder (Start==>Startup) and create a shortcut to your batch file. |
|
698. |
Solve : Changing a file ext to work in program . . .? |
Answer» I PURCHASED a paint by number program and I need to add my own color palette. I created the color palette in a different program and now when I save the palette and change the file extension to the one the paint by number uses, I get the following message: "An attempt was made to access an unnamed file past its end." Can someone help me get this color palette into this program? PLEASE!!! What paint by number program and what program created the color palette? Try PUTTING your message into a search ENGINE. I got 129,000 possibilities with Google. |
|
699. |
Solve : computer boot up into system configuration only? |
Answer» I would like to know if somebody can HELP me with windows 98 pc that keep on BOOTING into system config. I would like to know if somebody can help me with windows 98 pc that keep on booting into system config. |
|
700. |
Solve : Visual Basic beginner.? |
Answer» Win XP Home - VB 4. |
|