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.

51.

Solve : VBA (Excel 2000): using Cells(row, col) instead of Range("A1") in a Formula?

Answer» HI guys, just need a relatively simple way to convert a Range to a CELL value for Formulas.

EG.
"=SUM(D3+D4)"

INTO

"=SUM(Cells(3,4) + Cells(4,4)"      ' possible?

The reason is i have soft-coded the column numbers into something like 'LastColumn', and 'rowCounter', which  is useless if i'm forced to use Chars. any advice would be much APPRECIATED I'm having some DIFFICULTY making sense of your post.  First, your title doesn't make sense.  You SAY, "instead of Range("A1")", but A1 is not a valid range name; it is a cell address and all cell addresses are based on row and column.

You can name a range and then use that range name in a formula instead of a cell address.  Maybe that's what you're asking about.  For this to work, I believe the range name would have to refer to a single cell, not a range of cells.
52.

Solve : Simple Dice roller C++?

Answer»

Hi all,
Im working on a simple dice roller, just to figure out the rand() command, but i get an error when i run it.
My code is:

Code: [Select]#include <iostream>

INT main()
{
int d20;
d20 = rand % 20+1;
cout << d20;

return 0;
}

The error says something about rand() not being able to be used... any advice?
ThanksThe error says "d20.cpp:6: error: ‘rand’ was not declared in this scope" if that helpsNot sure, you MAY NEED all these:

#include
#include
#include

And put this early in the code so it will be different every time.

 srand ( time(NULL) );Was going to mention to seed the timer in your code, but Geek beat me to it. Seeding the timer makes your random GENERATOR not follow the same output everytime it is executed. As for runing your code over and over again if you pay attention to the output, it will always be the same, making it easy to cheat if you wanted to or knew how to follow the path of the algorithm alone to know what will be next.

 The Seed influences the algorithm based on time of execution, so it is very hard if not IMPOSSIBLE by human hands and perception of time to be quick enough and frequent enough to sync with this algorithm offset.

Pretty much for any random generator you want to use Quote

srand ( time(NULL) );
as Geek stated!

Unless of course you want to try to trick people into thinking you can see the future and can predict what 7 numbers will come up next after start of program..lol
53.

Solve : C++ and rand issue with flexible random integer generator?

Answer»

Well I hit an interesting one here. Maybe someone can show me how to resolve this issue. All other TIMES I have ever used rand for random generator in the past its always been predetermined integer ranges such as %10 to have 0 thru 9 unless you +1 to have 1 thru 10. Well I want to SET the range as adjustable based on what A is equal to, and when testing this out I didnt expect an error, I expected it to be happy with it and compile, but from the error message it clearly is not.

So I am curious as to how I can set the range to be flexible for the random generator if it doesnt like an integer variable declared at %A in the code below? This is just a small snippet from the PROGRAM, I declared INT A=1 and INT B=0; before INT MAIN() etc.

I can think of a VERY inefficient way to go about doing this by setting a ton of IF statements testing A's value, and then running the predefined %20 for 0 thru 19 if A = 19, but there has to be a much easier method to this.




Code: [Select]srand(time(0));
B=(rand()%A);

Quote

--------------------Configuration: Formula1 - Win32 Debug--------------------
COMPILING...
Formula1.cpp
C:\08_2011\Formula1.cpp(54) : error C2297: '%' : illegal, right operand has type 'double'
Error executing cl.exe.

Formula1.obj - 1 error(s), 0 warning(s)
Found my problem.... typo in which A was actually declared in list of Doubles instead of in list of INTs.... All set now!
54.

Solve : actionscript 2, movieclip button?

Answer» HELP me with this, i'm making a movieclip button that when mouse is over it will go to a different scene.



on(rollOver){
gotoAndPlay("Gameover",1);
}
when i do that it's accessing the scenes inside the movieclip,PLEASE help me,i need to FINISH this tommorrow.it has been a very long time since I used Any ACTION script, but would you not need to use:

Code: [Select]on(rollOver){
_root.gotoAndPlay("Gameover",1);
}
55.

Solve : Automatically attach file to access record?

Answer»

Hello world,

I wanted to know if it is POSSIBLE to have a files automatically attach to a record in ACCESS 2007?

I had to create a access db and we have to attach pdf's to each record, and I know that users are either going to complain that they have to attach the file to the record, or complain that it takes to long to attach the file to the record, so i wanted to know if I could have this done automatically?

the file name "*****.pdf" will match a field in the table, so i figured i just create or just find out if there is some code somewhere that LOOKS at this particualr field and then looks in a specific folder (which will ALWAYS stay the same) and MATCHES the pdf to that number in the field.

any help on this would be greatly appreciated.

thanks,

Danny

56.

Solve : Custom auto filter code?

Answer»

Hi there.

I just wander what the VBA code is to open a custom auto filter box in excel is?

I'm creating a dynamic worksheet, and when you click a command button you have a list of filters to choose from, and I wandered what the code is that opens a custom auto filter box and allow the user to make their selection. Quote

'm creating a dynamic worksheet, and when you click a command button you have a list of filters to choose from

Not really sure what your asking (some days I'm dumb as a brick ), but you can check if worksheets("name").autofiltermode is on and then use the .filters collection to cycle through the filters and place each one in a control for user selection.

  Quote from: Sidewinder on May 09, 2007, 03:47:54 PM
Quote
'm creating a dynamic worksheet, and when you click a command button you have a list of filters to choose from

Not really sure what your asking (some days I'm dumb as a brick ), but you can check if worksheets("name").autofiltermode is on and then use the .filters collection to cycle through the filters and place each one in a control for user selection.

 

I tried this but It didn't work.....

This is what I want. This is the code that filters the selected cells

Selection.AutoFilter Field:=1, Criteria1:="Name"

When you click the command button, it executes this code to filter the criteria you selected (from a drop down box).

I have all the codes working for the different criteria, apart from the Custom auto filter box. I just wandered what code, would allow you to click the command button and open an custom auto filter box.

Here is a picture just in case....



In an attempt to find this code, I found Selection.AutoFilter Field:=1, Criteria1:="=", Operator:=xlAnd but this does not allow the user to input their own selections.Thank you for clearing that up. At first I thought this would be simple enough to use the Application.Dialogs(xlDialog).Show method and then DISCOVERED there is no dialog for the Custom AutoFilter.

Only other thing I can think of it to show the xlDialogFilter. If you can get a handle on the collection of selections, you'll notice the Custom AutoFilter is always third on the list. (index = 2)

 What exactly do I have to do then? put what code under my command button?I was unable to turn up anything from the Net, nor was Microsoft very helpful. Even my world famous snippet closet (IMHO) came up empty

I guess in this case custom means do it yourself. Usually I find by doing something manually and recording a macro, that it produces the basis for more efficient self-written VBA code, but in this case the macro was empty except for some boilerplate comments.

My suggestion would be to design a custom dialog and grab the parameters you need to setup the Selection.AutoFilter STATEMENT. Or you could just let the user choose custom from the autofilter list and fill in the dialog.

Good luck. 

PS. For what it's worth, I did find there is a xlTop10Items constant.

Well you see the thing is, (because of my assignment guidelines) the user sis not allowed to select anything from the cells/filter list, so it has to be done by other methods 

And I don't know what this means "My suggestion would be to design a custom dialog and grab the parameters"?

One way I could do it is, have an input box appear and using a lot of variables and strings, adding them up and getting some sort of custom filter (perhaps difficult and a lot of bother)I guess if it were me, I'd design a form to duplicate the Custom AutoFilter dialog; show the form when the command button is clicked and use the data entered by the user to build the criteria1 and operator parameters of the Selection.AutoFilter instruction.

If you record and edit a few macros using the built in Custom AutoFilter dialog, you'll see the relationships between the data entered in the dialog and where they end up on the selection statement.

Both the VBA and the Excel help are great sources of information. As mentioned I was unable to find any information doing this with built in properties or methods. I'm currently using Excel 2002, so if you have a more recent model perhaps Microsoft addressed this issue.

 

When you say assignment, are you referring to homework

Quote from: Sidewinder on May 10, 2007, 03:12:53 PM
I guess if it were me, I'd design a form to duplicate the Custom AutoFilter dialog; show the form when the command button is clicked and use the data entered by the user to build the criteria1 and operator parameters of the Selection.AutoFilter instruction.

If you record and edit a few macros using the built in Custom AutoFilter dialog, you'll see the relationships between the data entered in the dialog and where they end up on the selection statement.

Both the VBA and the Excel help are great sources of information. As mentioned I was unable to find any information doing this with built in properties or methods. I'm currently using Excel 2002, so if you have a more recent model perhaps Microsoft addressed this issue.

 


I will now.

That is what I have been doing with most of them, creating macros then using autofilter options, than adapting it for my worksheet. Its just that recording the custom auto filter selection showed the code to be a bit more complicated, and I wanted to find the easiest way   

Quote
When you say assignment, are you referring to homework



Yes I am  but don't worry I am well within limits. My assignment guidlines say I have to create the worksheets, not what happens in them, this is merely fixing an error. After all, I have done all of it myself, I can understand and apply it just this particular code ELUDES because excel does not give info on it....

Basically, here is a LITTLE inside into my code (if it helps)

Basically, you select the filter option you want from the drop down box. Then click the command button which executes the code.



Private sub [......]

    Range("B3:B15").Select

    If COMBOBOX = "Make" Then
        Selection.AutoFilter
        Selection.AutoFilter Field:=1, Criteria1:="Make"
    End If
 
End sub


And here is the code I got from the Macros of Custom auto filter

ActiveWindow.SmallScroll Down:=-9
    Selection.AutoFilter Field:=1, Criteria1:="=", Operator:=xlAnd


But it is far to long for me to allow the user to do manually.

57.

Solve : omg i dont get this!!!?

Answer»

i have a few questions. So is visual basic and C++ 2 DIFERENT programing languages? visual basic is a program that actually uses visual basic programing LANGUAGE, but what program uses C++ programing language???

i know these are LAME questions but i dont get this. can someone please help me!!!

      thanks!!!!!!!!!
YES, they are two SEPARATE programming languages.oo, ok thanks

58.

Solve : PLEASE, NEED 2 LEARN, HELP A NOOB, GET A NOOBS BLESSING, AMEN!i guess?

Answer»

ok ive tried programming be4, but the only problem is that i dont even know for sure what programming it.

but ive always wanted 2 make programs, so if any1 could begin with short words TELL me what programming is....so i know what ........so i know if what i know is really what i know and want ........iam weird, i guess.

So i would guess that programming needs a program, would be nice 2 know the site 2 download it from or the name,......or both.


Well its really not much i need 2 learn, i just only need the program that is programming the programs and 2 know what i could be programming ,,,.....and a little more ^_^, and please reply, i need it.


ThANKS!




System
 
    Microsoft Windows XP
    Media Center Edition
    Version 2002
    service Pack 2



Acer Inc.   
AcerSystem   
AMD Turion(tm)64 Mobile
Technology MK-36
798 MHz.448 MB RAM
PAE (Physical Adress Extension)Not meaning to be offensive but there are TONS of posts on this one topic and some even on the first page of this topic. I suggest just reading through all the different topics and posts on the forum about programming. Quote from: M1CH431 on May 01, 2007, 05:08:07 PM

Not meaning to be offensive but there are TONS of posts on this one topic and some even on the first page of this topic. I suggest just reading through all the different topics and posts on the forum about programming.

But iam a STUPID noob =( it would dmg my brain 2 read all this stuff, but ill try until some1 helps me out ......be4 i HELP myself outIt seems your brain is already too damaged seeing as you are too lazy to type "damage" and "before", abbreviations can be a beutiful thing but after a while they just become annoying.i cant help it, its like STUCK in my head.....on my brain, the big brain.........i hate that there is more then 1 brains  , and as i said its like ........i dont know what iam saying, i need 2 sleep wow16Hours awake and ive got school in 4 H , so ill need 2 be up and take a shower after 2 H , 26-29 Hours that will be my high score, .......but still ill need 2 be up for 11-14 hours    wish me luck  , wow i hope i dont fall asleep in schoolNobody wants to do all your research for you. We'll help, but you have to show that you're motivated enough to actually begin.
& it hlps f u spl evrtng out lik u wr tot N scl. You're at a computer, not a cellphone.I have two requests...

shimal:  See a physician as soon as possible.

The mods:  Make some kind of sticky for this topic?
59.

Solve : Pascal to Java??

Answer»

I've been learning pascal for a little while now and learned the basics of the loops and how to sort. How FAR do I have to go in learning pascal before I'll be ready to take on Java? I tried learning Java from a book called Beginning Java 2 by Ivor Horton and I didn't understand a lot of what he was saying there, so I decided to give pascal a SHOT from then on.I've never used Pascal but the fundamental ideas of programming - conditional statements, loops, variables etc - are the same for almost all programming languages. So experiance with Pascal should help with Java generally. But I don't see any point in people learning one LANGUAGE in "preperation" for another. If you didn't like that book, try another or LOOK for tutorials online.Do you have any tutorials that you could suggest which helped you?I've not used Java myself, but I've used C++ which has some syntax simularities.

Try this? http://java.sun.com/docs/books/tutorial/Thanks I'll take a look into it.

60.

Solve : Algorithms Am I on the right track??

Answer»

I really want to understand this was wondering if I have the right idea as far as answering the questions so far. It seems to be so basic ~ for an example, I think if I input 55 the output would be both outputs: output "your grade is" 55  and output "you did OK", I  know X represents the integer right?

input X

if (0 <= X and X < 49)
   output "you fail"

else if (50 <= X and X < 70)
   output "your grade is" X
   output "you did OK"

else if (70 <= X and X < 85)
output "your grade is" X
   output "you did well"

else if (85 <= X and X < 100)
output "your grade is" X
   output "you did great"

endif
output "how did you do?"

•   What will be printed if the input is 0? "you fail" (would “your grade is X” also be an output?)

•   What will be printed if the input is 100? "you did great" (would “your grade is X” also be an output?)

•   What will be printed if the input is 51? "you did OK" (would “your grade is X” also be an output?)
•   What will be printed if the user enters “Wingding”? Nothing?
•   Is this design robust? If so, explain why. If not, explain what you can do to make it robust.
•   How many levels of nesting are there in this design?  4?
•   Provide a set of values that will test the normal operation of this program segment. Defend your choices.
•   Provide a set of test values that will cause each of the branches to be executed.
•   Provide a set of test values that test the abnormal operation of this program segment.
Any number less than 0, such as -1, or any number over 100 such as 101 and anything that is not an integer.
Yes, you are on the track.
What language is this? Quote from: Geek-9pm on September 02, 2011, 03:04:23 PM

What language is this?

An conceptual teaching language, maybe? I am not sure if it is a language, I am PRETTY new at this. So can someone tell me this..when would

endif
output "how did you do?"

pop up? I mean if there is no room for error, or no error output, would that even be relevant? And is my answer of there being 4 nesting correct? Or is only one nest since all the info comes in between input X and endif? I am sorry, I am trying to understand. Thanks for your input.As I  understand, you want to find where a scalper is in a range of values, then print a message for that range only. NORMALLY the variable is non the left and the constant t is on the right.
Here is a similar solution. We make a block and break out of the block when we are in a range.
Let invest a thing called "block" so we don't need the else if thing.
Code: [Select]begin block
if X < 50 {
output "you fail"
break
}

if  X < 70 {
output "your grade is" X
output "you did OK"
break
}

if X < 85 {
output "your grade is" X
output "you did well"
break
}

if  X < 100 {
output "your grade is" X
output "you did great"
break
}

output "your grade is " X
output "please report to the dean's office"

end block
output "end of report"

I believe this is what you intend, but it is maybe not self-evident, But that is how programmers do things.
It might be easier to understand if you made and object  that tests for range and outputs a message.
That is great, you have really assisted me in understanding this on a much better level. Thank you so much! Glad to help. Your problem can benefit from a CASE or SWITCH structure. Or you could create your own special function or procedure. You may like to read this:
http://en.wikipedia.org/wiki/Switch_statement
In some applications, maybe a network database,  reducing the block to  minimal code may be a critical issue to improve response time.
Quote
Optimized switch
To optimize a switch statement, the PROGRAMMER must USE a very compact range of possible values to test.[1] Sometimes it is necessary to convert the switch to a more suitable range using an inexpensive transformation. See algorithmic efficiency for an explanation of how the programmer can "assist" the compiler to make an efficient choice. See also the section 'Compiler generated branch tables' in branch table article for why optimization is not always performed as expected and how to solve this.
This can be an interlinings  area of study if you need to work with SQL or similar things.Geek, I don't think you realise what is going on here. I tried to give a hint, but you didn't take it up.

I'll try to make it simple.

1. The OP, webdev57, is not seeking help to write some code. He or she is seeking help with a school or college assignment.

2. The assignment is to read a program, written in a pseudocode and answer questions about how it would work.

3. How it would work, that is, if it were a real programming language.

4. The pseudocode contains structures and logic found in programming languages.

5. That is what I meant about teaching language but it evidently passed you by.

6. The above is obvious from the format of the original post, in my opinion.


Thank you Salmon Trout,
Did not mean to do his homework for him.  Quote from: Geek-9pm on September 03, 2011, 12:07:42 AM
Thank you Salmon Trout,
Did not mean to do his homework for him. 

I think you were OK, he asked enough questions to show that he was thinking the project through, and he seemed to want confirmation that he was on the right track, as his title says.

I just thought you were wasting your time re writing the code though. Helpful though that seems to have been.

Quote from: Salmon Trout on September 03, 2011, 12:11:31 AM
...

I just thought you were wasting your time re writing the code though. Helpful though that seems to have been.
His code was hard to read. It was redundant and would never do inside of a loop. I just had to re write it. Quote from: Geek-9pm on September 03, 2011, 01:02:21 AM
His code was hard to read. It was redundant and would never do inside of a loop. I just had to re write it.

It wasn't "his" code; I am pretty sure of that, and I don't see why it shouldn't work within a loop. Why do you say that? Since it is in a yet-to-be-determined language, we cannot make assumptions like that.
The code listed asks the user to input a number and then using conditional logic, do various things depending on the value of that number.

The code is written in a kind of generic "does-not-actually-exist" programming language. The object of the exercise seems to be to evaluate the student's ability to read source code and deduce what it does, independent of any particular language implementation.





Salmon Trout. You are very perceptive. I  made the mistake of thinking he wrote it.
I did not say it would not work. I was guessing that a compiler would not optimize it.  i think this language must be visual basic right? ..oh how really miss studying its been 3 years since i last practice my programming skills fortunately i joined such forum thanks guys for some refresment
61.

Solve : Log file from batch file?

Answer»

I created this batch file (XP Cleanup.bat) to faster automate deleting temporary files.  I CURRENTLY have the batch file logging the user, start, and end time of when it ran.  I would like to have a more detailed log file. For example how many files from each location were deleted and the time to do it. I am not SURE that this is even possible.  I found that USING the command (dir "%userprofile%\COOKIES" /b/s /a-d |find /v /c "::" >> Cleanup.txt) would GIVE me the number of cookies/files in the “Cookies” folder. When I try to create a variable with the command (dir "%userprofile%\cookies" /b/s /a-d |find /v /c "::" ) it errors.  Can anyone help me?

Thank you.


XP Cleanup.bat
ECHO OFF

cd "c:\T1"
echo %userprofile:~26% >> Cleanup.txt
echo Start:  %Date% %time% >> Cleanup.txt

title Deleting Cookies. . .
cd "%userprofile%\Cookies"
del *.* /F /S /Q /A: R /A: H /A: A
cls

title Deleting Internet History. . .. . .
cd "%userprofile%\Local Settings\History"
del *.* /F /S /Q /A: R /A: H /A: A
rmdir /s /q "%userprofile%\Local Settings\History\History.IE5"
cls

title Deleting Local Temp Files. . .
cd "%userprofile%\Local Settings\Temp"
del *.* /F /S /Q /A: R /A: H /A: A
rmdir /s /q "%userprofile%\Local Settings\Temp"
cls

title Deleting Local Users Temporary Internet Files. . .
cd "%userprofile%\Local Settings\Temporary Internet Files"
del *.* /F /S /Q /A: R /A: H /A: A
rmdir /s /q "%userprofile%\Local Settings\Temporary Internet Files\Content.IE5"
cls

title Deleting Windows Temp Files. . .
cd "C:\WINDOWS\Temp"
del *.* /F /S /Q /A: R /A: H /A: A
rmdir /s /q "C:\WINDOWS\Temp"
cls

title Emptying Recycling Bin...
rem must copy nircmd.exe to System32 folder to work
nircmd.exe emptybin
cls

cd "c:\T1"
echo Finish: %Date% %time% >> Cleanup.txt
echo. >> Cleanup.txt

EXIT


Cleanup.txt
Default
Start:  Wed 05/02/2007 21:50:48.78
Finish: Wed 05/02/2007 21:50:48.88
Code: [Select]for /f %%i in ('dir "%userprofile%\cookies" /b/s /a-d ^| find /v /c "::" ') do (
   echo %%i >> Cleanup.txt
)

 Thats got it.

Thank You!

62.

Solve : Script-Permanently Map Network Drives??

Answer»

Good weekend EVERYBODY!

How can I permanently map network drives to NOT be dependant on a LOGGED in account?

Details:
I have a script that will automaticaly backup content from network drives.  It seems that if I schedule this batch file to run using the Windows 2003 Standard Server Edition's task scheduler it will run fine, as long as I'm logged in.

Once I log out, the script will not fully run because the mapped drives are disconnected.  How can I permanently map network drives?

I have also seen this on XP Pro, where even if the option to remap on login is selected, XP will not do so and I manualy have to EXPLORE and open the corresponding mapped drive icon.  Try using UNC paths instead of mapped paths. The UNC path should always be available.

 UNC paths worked.
-------------------------
Update

   90% of the script worked but an executable I found that will eject the DVD drive will still NOT run while logged off.  does anyone have any ideas. 

TESTED the script directly (while logged in)-- sucsesfull
Tested Scheduler (while logged in)-- sucsesfull
Tested script /w scheduler (while LOGGED OFF)--  EXE failed to run.

63.

Solve : Game programming language?

Answer»

If i was to learn to program computer games what language would you suggest i learn? It would preferably not be extremely complicated but would allow you to create 3d good looking games. So a language that will allow me to write a variety of games that people will like. If complication was not an issue what language would you suggest? ThanksUsually people make 3d games using Macromedia Flash or Game Maker or something....
It all depends on what kinds of games you're trying to make really.
Games that you use the arrow KEYS to move a character through a course of levels is usually done with Game Maker or Macromedia.
Other games like tick tack toe can be made with C++...

Hold on a bit and someone might KNOW the answer to your question.what about torque?http://www.blitzbasic.com

Go to products.

Blitz Max is the latest version. It's the newest and most advanced, but supports only 2D out of the box. 3D capabilities are being developed but for now they are not that easy to use. If you weren't interested in 3D I would have recommened this. The syntax has been revamped so is quite different from the other products.

Blitz3D sounds like what you are looking for. It allows you to create 3D (and basic 2D) games quickly and easily.

Blitz Plus makes 2D games only, but is cheaper.

You can try demo versions of each of these to see which ones suit your needs. If you have any futher questions, ask. If you are a hobbyist game programmer I would certainly recommend them. They are far more SOPHISTICATED than game maker, though a bit harder to learn. If you want to make games professionally then you will need to learn C++/C#.what language can you learn to create games for xbox? Is torque a good CHOICE?Torque seems ok but expensive.....
As for creating an xbox game, unless you work for a company that makes xbox games you can forget about it.If you have limited prior experiance in programming, then you should focus on simple PC games for now. If you can't make basic eg platform games/tetris those kinds of games for the PC then you will have no chance for the xbox. Sorry to dash your dreams, but if you want to create serious games, serious work is needed.so where do you suggest i start? Macromedia Flash is good for making short movies and games. You need good art skills though.You guys make it seem necessary to learn simple programming to learn more intense code. Is that true? Well each person learns at their own rate. What languages are you already experianced in and what games have you made so far?I myslef have made some C++ games and a whole load of Batch games.in the top of this topic game maker was suggested i think its a good place to start and even old hands at programing may be surprised at the kind of results you can have I've used it several times and there's a free version that comes with samples so you can pick at it and examine how the codes work try it  you can learn from it and its pretty cool to experiment with the 3d capabilities that are  there but unless you buy the licensed version (not necessary ) it doesn't come with the 3d sample game but at game maker just put  that in your search , you can also get a sample game of a doom clone and i think you can tweak it,dice it and learn from it as well . hope that helps its written in a modified version of basic or vb one or the other but i think they call it gml not sure , hope that helps .Game Maker is good for games.
When really going 3D, I suggets giving DarkBasic a try. It's easy enough to master the basics of it, and virtually limitless in a sence of game TYPES. I even heard someone maaged to make a VR game with it, not confirmed though.You could probably make a VR game with any capable language.

64.

Solve : IF Statement in C Language?

Answer»

Hi everybody

Recently I've started learning to program . I've checked a tutorial about IF Statement in C language . the first tutorial was the very basics of the language , and the second about the IF Statement . I tried to marriage both tutorials and apply what I learned . So I tried to write a code that uses (( in this_is_a_number )) variable , and IF statement in the same time . This is the code :

================================================================

#include

int main ()
{
     int this_is_a_number;


  printf( "Please enter a number: " );
  scanf( "%d", &this_is_a_number );
if ( 5 < %d ) ;
    printf( "Five is now less than %d , that's a big surprise" , this_is_a_number );
if ( 5 > %d ) ;
    printf( "Five is more than %d , that's bad" , this_is_a_number ) ;

    getchar();
  return 0;
}

================================================================

The compiler (Code Blocks) gave me the following error message :

error : expected expression before '%' token - Line 10
error : expected expression before '%' token - Line 12

The thing I NOTICED is that the (%) is in red , but the (d) is in black , although they should be in the same color both .

I use Windows 7 if it's important to mention


Please help guysPlease remove blank lines and use a code block when postiong.
Like this:
Code: [Select]#include <stdio.h>
int main ()
{
     int this_is_a_number;
  printf( "Please enter a number: " );
  scanf( "%d", &this_is_a_number );
if ( 5 < %d ) ;
    printf( "Five is now less than %d , that's a big surprise" , this_is_a_number );
if ( 5 > %d ) ;
    printf( "Five is more than %d , that's bad" , this_is_a_number ) ;
    getchar();
  return 0;
The semi colon symbol ';' is used to mark the end of a statement.
The brackest eanclose a block.
Like this:
Code: [Select]#include <stdio.h>
main(){
  int i = 3,j = 5;
  if(i < j){
     printf("i < j \n");
  }   
}This example has an IF balock in side the main block.
Use  blocks for your IF statemtns.More simply. Lines of code that start with if, for, or while end with a { instead of a ;

This is because these lines start what is CALLED a code block.

ex:

if(a == 1) {
   code goes here;
}Hi guys m thanks for your help


But I do not think that was the problem .

Check this link of the tutorial :
http://www.cprogramming.com/tutorial/c/lesson2.html

Check this code in the link above .
  Code: [Select]if ( 5 < 10 )
    printf( "Five is now less than ten, that's a big surprise" );

I tried to compile this code this way , and that worked :
Code: [Select]#include <stdio.h>

int main ()

{
if ( 5 < 10 )
    printf( "Five is now less than ten, that's a big surprise" );
    getchar ;
return 0 ;
}

I mean without the {} before and after the IF statement . But anyway , I did what you said guys , and tried the code this way :
Code: [Select]#include <stdio.h>

int main ()
{
     int this_is_a_number;


  printf( "Please enter a number: " );
  scanf( "%d", &this_is_a_number );
if ( 5 < %d ) {
    printf( "Five is now less than %d , that's a big surprise" , this_is_a_number ) ; }
if ( 5 > %d ) {
    printf( "Five is more than %d , that's bad" , this_is_a_number ) ; }

    getchar();
  return 0;
}

The compiler (Code Blocks) is still giving the same error message , which shows the same two lines of code , which are line 10 and line 12 . And the % is still in red , while the (d) is in black , they should be both in the same color , so the code recognize them as one object .

I attached a screenshot of the compiler do you can see the color of the (%) and the (d) , as well as the error messages below in the picture .

Aren't there any other ideas ? 

Please help guys   

[regaining space - attachment deleted by admin]%d is only a placeholder within the printf format string.

It is meaningless outside of that.

for example- say, in your if statement itself. if(5 > %d) basically translates to 'if 5 is GREATER than modulus d' which makes no sense.

refer to the variable name, this_is_a_number when you want to refer to that variable. if(5
But I do not care about wether it works or not . Because the reason of my posting here isn't to make work , it's just to learn where's the problem and how to write the code correctly . Could you explain how variables work with IF Statement , and why should I use the variable in IF Statement , and use %d in Scanf and Printf function ??

65.

Solve : C++ coding?

Answer»

I wrote this code and I am unable to compile and run it. Everytime I try and compile it, I'm always getting a lot of errors and I can't seem to figure out what is really wrong. I am using Microsoft Visual Studio C++ 2010 as my compiler. Also, I am trying to substitute out the logical equality operator "==" with "<=" and also ">=" just to see what HAPPENS. Here is the code...



#include
#include

using namespace std;

struct student_record
{
string firstname, lastname;
double age, income;
int number_of_children;
char sex;
};

int main()
{

student_record Mary;
student_record Susan;

cout<<"Enter the firstname and lastname: ";
cin>>Mary.firstname;
cin>>Mary.lastname;
cout<<"Enter age: ";
cin>>Mary.age;
cout<<"Enter income: ";
cin>>Mary.income;
cout<<"Enter number of children: ";
cin>>Mary.number_of_children;
cout<<"Enter sex: ";
cin>>Mary.sex;

Susan = Mary;

if (Susan == Mary)
{
cout<cout<cout<cout<cout<}
return 0;
} Quote

char sex;
char sex[];


Quote
cout<<Susan.number_of_children<<ENDL
cout<
Quote
};
Thinking you need to define something as an object between the } and ; such as in the code on this linked page: http://msdn.microsoft.com/en-us/library/64973255(v=vs.80).aspx

The compiler itself gives you a lot of useful information to help point out syntax errors. If you click on the line in the error log it will highlight the line where the issue is, however sometimes the compiler cant interpret what your intentions were and so you get an error that doesnt point to a single line which can get frustrating especially if your code all looks good and its a difference between one compilers format and another. This can happen if you are missing an #include or if your compiler requires the .h at the end of an #include as I found out long ago with Borland. Quote from: DaveLembke on September 12, 2011, 07:21:31 PM
char sex[];

M or F would be a single character.

Code: [Select]if (Susan == Mary)

should be:

Code: [Select]if (&Susan == &Mary)

If you want to see if two object references  are the same, you need to compare the addresses of the objects. using == will try to call the overloaded comparison operator, but your struct doesn't have one.I usually declare my Chars with char Tag[];  so that if by accident the user enters 2 or more characters such as "Male" it doesnt overflow, and my if statement following it would test the input to make sure it is M, F, m, or f and not FF etc, and if more than 1 character and if the character isnt 1 of 4 valid inputs state the error and request proper input. This input sequence would be nested in a loop whereas if the correct single character is input, the loop would be met and leave loop. But yes BC your correct in your statement that it was ok for a single character input. I should have commented on why I suggested that. Quote from: DaveLembke on September 14, 2011, 01:43:37 AM
I usually declare my Chars with char Tag[];  so that if by accident the user enters 2 or more characters such as "Male" it doesnt overflow,
It won't overflow. but it will fill the input buffer. the proper way to fix this in a C++ program would be to actually use C++, rather than C, constructs. In this case, strings:

Code: [Select]#include <iostream>
#include <string>
#include <algorithm>

using namespace std;



int main()
{
string inputline;

for(;;)
{



string charinput;
cout << "\nPlease input a letter: ";

cin >> charinput;
while (!isalpha(charinput[0]))
{
cout << "You have entered an invalid input, please input a letter: ";

charinput.clear();
cin >> charinput;
}
transform(charinput.begin(), charinput.end(),charinput.begin(), ::toupper);
cout << "first character was " << charinput[0] << endl;
if(charinput[0]=='q' || charinput[0]=='Q') break;
}





return 0;
}

In this case one could just take the first character of the string. This would allow people to enter "FEMALE" or "Male" or "Man" or "Femme" or "Filly" or something crazy like that. Or, of course, one could at that point check for first character, but presumably the input prompt would make it clear what they should do.

Quote
and my if statement following it would test the input to make sure it is M, F, m, or f and not FF etc, and if more than 1 character and if the character isnt 1 of 4 valid inputs state the error and request proper input.
There is of course one problem THOUGH, and that would be if they input characters past the number that you declared for the array. Also, in the example above, I just uppercase the entire string before checking the first character, so I would only need to check for M or F, and not m and f.

I didn't mention any of this, since it had absolutely nothing to do with their issue.
66.

Solve : Advanced Startup question .bat?

Answer»

I made an arcade and set the winlogon shell to C:\hyperspin.exe.
I have a ps3 CONTROLLER and for it to work i need to also run C:\ps3\ps3.exe.
Someone said i need to make a batch file to run them both under shell.

I do not have a clue how to do this.  Could someone write the code so i can copy paste it?
Please help, Thank you.
I generally go with keyboard macros for batches that need to LAUNCH multiple services/drivers etc as for that is a problem with batch in that it wont make it to the NEXT line until the process at the first line has started and stopped.

Sometimes I have been successful adding START to the beginning of each line ... you can try adding START to each line.

67.

Solve : SQL Query involving 2 tables and average of multiple rows?

Answer»

Need a quick answer to this question, pls:

strQuery2 = "SELECT AVG(b_total * exchrate) FROM tblProspects INNER JOIN tblEFHist "
strQuery2 = strQuery2 & "ON tblProspects.jobNo = tblEFHist.jobNo WHERE Month = '03/01/2007' "
strQuery2 = strQuery2 & "AND tblProspects.jobNo = '" & ws.Cells(counter, 1) & "';"

Examples:
==========================================
Date                 |    B_Total             |   ExchRate
--------------------------------------------------------------
01/03/2007      |    2,000                |   0.5
--------------------------------------------------------------
01/06/2007      |    7,000                |   0.3
--------------------------------------------------------------
01/03/2007      |     4,000               |   0.5
==========================================

I need it to RETURN the figure of AVG (2,000 * 0.5 + 4,000 * 0.5)... as in the avg of 01/03/2007

I'm afraid i MESSED up somewhere, as it doesn't GIVE the answer it should. I basically need the  calculated AVG of MULTIPLE rows ( as seen above, from tblProspects) but conforming to a particular date (from ANOTHER table, tblEFHist)... thanks in advance!

68.

Solve : Really bad case of fragmented files?

Answer»

Title tells you what this is about. When defragmented a vast amount of fragmeted files will not be defragmented. The computer hasn't been defragmented for years so there is about 90% of files are fragmented. We have tried to defragment multiple times but it does't make a difference. So what is the solution to this other then re-format?


Edit: Disk cleanup was ran before defrangmenting.I don't know if anyone else will agree with me or not, but I think the only way to fix all of those files is to do a reformat.  Especially since it's over 90% of your system.  I had a computer that hadn't been defragmented for years too and it really got bogged down because of it.  I ended up reformatting and it worked as good as new.  Don't forget to back up important documents!TRY a BETTER defragmentation program.

I use Sysinternals' POWER Defragmenter (+ GUI) Is that other defragmenter on the computer or downloadable? Quote from: Idea CONSULTING on May 03, 2007, 08:37:34 AM

Is that other defragmenter on the computer or downloadable?

Google for it, it's freeware. www.diskeeper.com

Costs money, but as far as I know the best defragmenter on the planet. A reformat would SOLVE the problem, but is a bit drastic.

How much free space do you have? If you have too little, you will not be able to defragment effectively.
69.

Solve : while loops?

Answer»
  Hi, I'm trying to learn Java from a book i found at the local library, is this possible without actually having the software? And secondly, can anyone show me an example of a Java while loop using if and else?. The task I've set myself is to sort a pack of cards (20?) with only four different images, 2 squares shaded/plain , 2 circles shaded/plain.Any help would be appreciated.

Regards Cat. Code: [Select]function BreakTest(BREAKPOINT){
   var i = 0;
   while (i < 100)
   {
   if (i == breakpoint)
      break;
      i++;
   }
   return(i);
}
* courtesy Windows Scripting Technologies

Quote
I'm trying to learn Java from a book i found at the local library, is this possible without actually having the software

It's EASIER if you have the software so you can follow along. I do not recommend this should you have an interest in learning to fly.

70.

Solve : i need Explanation for my C progrm?

Answer»

Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL..

...i need Explanation for this code....

#include
#include

int main()
{
   MYSQL *conn;
   MYSQL_RES *res;
   MYSQL_ROW ROW;

   char *server = "localhost";
   char *USER = "root";
   char *password = "PASSWORD"; /* SET me first */
   char *database = "mysql";

   conn = mysql_init(NULL);

   /* Connect to database */
   if (!mysql_real_connect(conn, server, user, password, database, 0, NULL, 0))
   {
      fprintf(stderr, "%s\n", mysql_error(conn));
      exit(1);
   }

   /* send SQL query */
   if (mysql_query(conn, "show tables")) {
      fprintf(stderr, "%s\n", mysql_error(conn));
      exit(1);
   }

   res = mysql_use_result(conn);

   /* output table name */
   printf("MySQL Tables in mysql database:\n");
   while ((row = mysql_fetch_row(res)) != NULL)
      printf("%s \n", row[0]);

   /* close connection */
   mysql_free_result(res);
   mysql_close(conn);
}We don't do homework...the EXPLAINATION is in the code.... the /* */ are quotes that say /* Connect to database */ well that code is connecting to database???

you should really look elsewhere for a profession

71.

Solve : Verifying file stability using DOS command?

Answer»

I have flat TXT files SENT me and I need to verify if the file is stable or unchange before executing a BAT file  !!!

Is there any way (using DOS) I can verify that the file is in a stable state before executing my bat file  If you have two copies of the file, you can try this:

COMP FILE1 file2

If not, you can always set the file to read-only:

ATTRIB +R filename

72.

Solve : Paranoid Programming Language?

Answer»

The more I read, the more I am entertained.
http://paul.merton.ox.ac.uk/computing/paranoid-programming-language.htmlomg IVE been using this for years now ,ha ,ha, ha ,ha ."IF x WAS_EVER 100 THEN
          DON'T PRINT(x) " TOOO funny THANKS for the LINK.

73.

Solve : Re: For my fellow newbies?

Answer»

Hi , rain or anyone ELSE that would care to answer , I'm learning Ruby  myself and having trouble with creating a program , the program must alphabetize any word typed and do a gets.chomp kinda thing. Thats the problem i cant get the hang of arays I'm trying to create the program so it takes the as many words as a person WANTS to TYPE and after presing enter  and SORTS it alphabetically then when the enter button  it sorts the word and if enter is pressed with out a word then  the output is printed as a alphabetized list on the screen . if this is the wrong place to post this , im sorry . as far as i can figure it would look sorta like this .


puts 'please type a word'
word = gets.chomp
while word = sort
   word == TRUE
   nil = false
   if false == puts
    end
i know this is wrong thats why im here what would it look like if i used arays in this ? and how do i use the sort comand does the Ruby language just automaticaly sort the strings  alphabetized ?
Owell anyhelp would be apreaciated , thank you in advance.

74.

Solve : Backup up to different folders with batch file?

Answer»

I was given this example for scripting by Sidewinder:

echo off
for /f "tokens=1,2" %%x in ('DATE /t') do (
   set dow=%%x
   )
if %dow%=Mon set FOLDER=c:\Monday
if %dow%=Tue set folder=c:\Tuesday

How WOULD I implement it on my backup batch file to backup to different folders depending on the date?  I attempted the modification of it but GOT a '=Mon' was unexpected at this time message!

:BackupStartMessage01
SLEEP 2
ECHO+
ECHO+
ECHO The backup process has now been started...
SLEEP 3



:Log Backup-Start
ECHO %date% Backup STARTED at %time% on workstation %computername% >> F:\Backups\Division01backup\backuplog.log

:Backup01
ECHO+
ECHO Now starting first process!
ECHO+
ECHO A | Xcopy "X:\Box01" "F:\Server01\Division01\Folder01" /S /E /V
ECHO+

:Endof01 Backup01
SLEEP 3
ECHO Folder backup has been completed!
ECHO+
ECHO+

:Backup02
SLEEP 2
ECHO A | XCOPY "X:\storage\Box02" "F:\Backups\Division01LBACKUP\Folder02" /E /S /V
ECHO+
SLEEP 2
ECHO+
ECHO Folder backup has been completed!
ECHO+
ECHO+

:Complete
SLEEP 4
ECHO+
ECHO+
ECHO BACKUP PROCESS IS NOW COMPLETE!


:Log Backup-End
ECHO A log file is now being creted
SLEEP 2
ECHO %date% Backup ENDED   at %time% on workstation %computername% >> F:\Backups\Division01backup\backuplog.log

:END

75.

Solve : Net Logging batch?

Answer»

How would I be able to create a batch file to log the internet history of a USER withought getting, what I think are, encrypted folders; and having it RUN every TIME content is automatically added by wondows?why do you want to get internet history? There are programs to do that already.I need to randomly monitor some PC's withought having to run a full fledged PROGRAM and withought users getting suspicious due to tray icons, etc.

76.

Solve : Trouble learning to program?

Answer»

i tried learning a program also.  i tried vb.  then java.    sad to say dat i really dono how to program. grrrr or may i'm just too d***.  maybe my brain is stained already (sigh!).  or maybe i need to learn word for word about DOS, since i just know basic DOS....grrrr....

i dono, i'm a frustrated programmer forever  .There is not much need to learn anything about DOS, unless you intend to travel BACK in time. I would highly suggest against language-hopping. Although you might find a language you prefere more, I feel you are just doing it because you gave up too easily, and continuing this will demoralise you futher.

I would suggest sticking around with Visual Basic a bit more? What version are you using, and what tutorials? What can you do? Do you know how to create a simple form with some buttons and text boxes?ya i give up easily. too bad for me.

nwys, my vb is 2005 express edition.  my first prog was my lucky seven.  after that, i didn't make any from vb.

i tried java also but i dono how to save the hello world...grrrr...and i dono i to compile and run it. grr and another grrr....

right now, i'm doing python(i read it from the previous topic).  kinda interesting.  hope i will not give up on this one.I can't see any particular reason why you gave up so QUICKLY on Visual Basic. What is your ultimate goal? What kind of programs do you want to make?just anything i can make, hopefully. depending on the program that i will learn in the future. right now, just concentrating on python.  hope i can learn from this one w/o giving up.

tsk tsk tsk, bad for me coz i usually start w/o finishing .

i will just cross my fingers.  hope i can learn and will be learning.You know what I think you need?

A book.

I know, it seems dumb with all the online tutorials out there, but I think they're only good as a reference, sometimes not even that. But there's something about cracking open a book that gets the mind going. Plus, the books you buy have to go through peer reviews before publishing, so the content is much better.

Check your local bookstore, or some of these links:

http://tinyurl.com/3dcpfw
http://safari.oreilly.com/1592000738
http://wiki.python.org/moin/BeginnersGuide/Programmers

Some of these you can read online. Take it slow. I first tried to learn C++ two years ago, and I failed utterly. Today, Neil can tell you that I've got a long way to go, but I'm improving steadily. I'm getting to the point where I can write utilities for my computer, and I'm working on more complex concepts like Object-Oriented-Programming. It's a long road, but the rewards are excellent.

When I mean "take it slow", I really mean it. My C++ book says I can learn the language in 21 days, but that's a huge LOAD of bologna. Take your time, learn individual concepts before moving on.

If I knew Python, I'd probably give more detailed advice. Sadly, I don't. However, I'm sure some people here do, and I know there are Python forums, with people who can answer questions you have. One of the hardest things I learned is that, sometimes, the only way to progress is to ask people for help. And it is quite embarrassing for me, sometimes, to have people look at your code and say, "you're doing it wrong." But it allows for progress.

Good luck learning Python. I may not be able to help with specifics, but I *am* proficient in the concepts of programming in general, as is Neil, here. (I don't know how much Python he knows, so I'll make no assumptions.) If you've got any questions, ask away. We'll be here - most of the time, anyway. My portfolio, as such...

  • C++
  • Javascript
  • PHP (learning)
  • Blitz Basic
  • VB, but a long time ago and I've forgotten

No Python My own:

Interpreted
  • batch
  • (X)HTML
  • CSS
  • XML (been a while)
  • JavaScript (somewhat spotty, but it's there)*
Compiled
  • Visual Basic (very spotty)
  • C++ (learning)

No Python for me, either. I also know a couple program-specific interpreted "languages", such as writing events for the old Civilization II, and a couple other program-specific stuff, but they don't really count.

*Yes, I know that JS is based on Java, based on C++. However, it's a heck of a lot easier to do "document.write()" than C++ will ever be. Quote from: javanesence on March 30, 2007, 05:05:25 PM
just anything i can make, hopefully. depending on the program that i will learn in the future. right now, just concentrating on python.  hope i can learn from this one w/o giving up.

tsk tsk tsk, bad for me coz i usually start w/o finishing .

i will just cross my fingers.  hope i can learn and will be learning.
Python is very easy to learn. go to the official documentation site. Take the tutorial and browse through the site. If there's anything you are stuck, you can ask here (or other forum). I or the good ppl here will help if  we can. You won't regret learning Python.




Quote from: Dilbert on March 30, 2007, 05:55:52 PM
*Yes, I know that JS is based on Java....
On the contraryBASED on, ghostdog, not the same. Similar concepts, somewhat different syntax and very different implementation. I know. Just dont give up like that. I read a C++ book that was thin and basic, but it took me over a year to understand it. Heres some advice:
If you like math, and are good at it, you will enjoy computorer programming.
Think about it,

Int I=100;
Int H= 0
Int A=60
Int Math = I * H + A

It would equal 60.
Just like algabra. If you hate math, computor programming may not be for you.

If anything ends up more STRESS than PLEASURE... you should find somthing else to do. I'm not saying you said quit, but im just saying
Dont try to catch a train that isnt coming....
If you work hard, you can do anything....if you want to program bad enough you can do it im not going to be a cheerleader for ya but this may help .you dont know witch language you want to learn because you have no direction are you looking to program games make windows applications ? perhaps  a.i. chater BOT to talk to there are only as many limitations as your motivation imagination and drive . Find what you enjoy doing on computers then find out what language it was written in if you arn't enjoying the jorney to programing then you could be traveling the wrong path .but my best wishes to you .you can do it if you are motivated and want it enough.
77.

Solve : From PHP to Windows Apps?

Answer»

My background is web based programing predominately PHP/MySQL.  I currently find myself working on a project that I would like to CONVERT to a windows based application.  There is really no need other than to give a user a choice of what type of application they use.  The things I need to be able to accomplish are:

1: Password protection/user management
2: Database integration
3: Local NETWORK access to certain files
4: Remote workstation access on the LAN/Printers
5: Multiple user access to the program but obviously not to the same records/files

I am doing some looking at python right now (no really I have another tab open in my browser) for the first TIME so I am unsure if this is the solution YET.  I guess my MAIN concern is finding a language that is somewhat similar to what I already know.  Any suggestions would be greatly appreciated.No one has a suggestion?   Visual C++?

78.

Solve : C++ Console App text display refresh question?

Answer»

When running a C++ program that displays for example the prior text and then a cartwheel with a percentage of complete for an installer, what method do people use to show the ascii text transition so that the prior text above it doesnt have to be refreshed. Currently I have a loop that displays the static text above it with a progress bar and the progress bar I have a cartwheel by use of stepping "/" then "-" then "\ "then "|" and repeat with a percentage to the right of it to show the progress, and the cartwheel pauses and continues when it reaches portions that take longer to process. The text above it flickers with each transition since it is reprinted to display after a system("cls"); routine, since otherwise you will have it scroll down each transition.

Was wondering if someone here could show a better method to get rid of the flicker and EVEN the use of the nasty system("cls"); command

ThanksIn most programming languages you have a way of setting the row and column where text output is to be displayed; in many flavors of BASIC it is called LOCATE. The idea is that you first show the fixed text and then you move the cursor to the start of the changing text and repeatedly refresh it by overwriting. By doing this you do not have to repeatedly clear and write the whole screen. In your C++ implementation you may have the SetConsoleCursorPosition function, or you can simply print the fixed stuff and then in the loop you can repeatedly update the line that will be changing by moving the cursor to the beginning of the line by using printf("\r").


I should have added... when you are sending your cartwheel and percentage you do not want to have a newline "\n" at the end. (This leads to the scrolling you mentioned.)
An example of what I mean... this prints 2 fixed lines and then on the same line (the third line) it prints 6 successive changing lines and then finally "Done" on the 4th line. In my Borland C++ 3.00 the sleep(n) function in dos.h waits for n seconds.

Code: [Select]#include <stdio.h>
#include <dos.h>

void main()
{
  printf("Fixed Text line 1\n");
  printf("Fixed Text line 2\n");
  sleep(1);
  printf("Varying Text 1\r");
  sleep(1);
  printf("Varying Text 2\r");
  sleep(1);
  printf("Varying Text 3\r");
  sleep(1);
  printf("Varying Text 4\r");
  sleep(1);
  printf("Varying Text 5\r");
  sleep(1);
  printf("Varying Text 6\n");
  printf("Done\n");
}
Thanks Salmon!   When I get home from work I will check that out. Never seen the \r function before. Dont recall seeing it in any of my C++ books. Guessing that \r means Replace Line similar to \n New Line.\n is newline, \c (I believe( is carriage return (ASCII character 13); ASCII 10 is line feed. On windows a newline character is a character return followed by a linefeed. Character return returning the cursor to the start of the line, linefeed moving it down one. You can use \l (I think that is the escape character, could be wrong) to move the line down but not return the character to the start, as well. Quote from: BC_Programmer on October 03, 2011, 07:27:21 PM

\c (I believe( is carriage return (ASCII character 13)

new line is \n

carriage return is \r

Think of a teletype machine with a carriage that can move LEFT and right (that holds the paper which is wrapped around a roller) and a fixed print head. Carriage return moves the carriage back (returns it) so the print head is over the leftmost character position. Newline returns the carriage and then moves the roller one lines worth of rotation "upwards" so that the print head is over the next line.




Thanks for describing it like a teletype. That visual helped me better understand the \r At one time a teletype was the usual output device for computers, and later on you got a type of CRT + keyboard terminal sometimes nicknamed a "glass teletype". In many ways text output to the console is still based on teletype concepts.
Thanks for the HELP. Below is a quick test of it in action. Works Awesome! I guess I was spoiled to never have to use a teletype. When I dove into computers in 1983 I had a monochrome display with Basic. The closest thing to a teletype was the dot matrix printer printing out my listed code or printing out fake Point of Sale transactions for school projects like the Grand Onion that I remember the teacher having us create a spoof of Grand Union Food Store.

Code: [Select]//Testing \r with pretend installer
#include<iostream>
using namespace std;

int a,b,x,i=0;

int main(){
    cout<<"Installation Simulation - using Slash R\n";
    cout<<"=========================================\n";
    while(i<=15){
    //increment while loop counter placed here to change from 0 to 1 prior to loop
    i++;
    //Return and Display progress
    if(i==1){
    cout<<"\r"<<"*                [  5% ]";
    }
    //For delay placed here so that no delay on first display of 5%
    //For delay used so that you can see transition of STEPS vs only displaying last print
    //Very large number because fast computer can crunch out the 10 million calculations of b=a
    //quickly
    for(x=1;x<=100000000;x++){
                      b=a;
                      }
    if(i==2){
    cout<<"\r"<<"**               [ 10% ]";
    }
    if(i==3){
    cout<<"\r"<<"***              [ 15% ]";
    }
    if(i==4){
    cout<<"\r"<<"****             [ 20% ]";
    }
    if(i==5){
    cout<<"\r"<<"*****            [ 25% ]";
    }
    if(i==6){
    cout<<"\r"<<"******           [ 30% ]";
    }
    if(i==7){
    cout<<"\r"<<"*******          [ 35% ]";
    }
    if(i==8){
    cout<<"\r"<<"*********        [ 42% ]";
    }
    if(i==9){
    cout<<"\r"<<"**********       [ 50% ]";
    }
    if(i==10){
    cout<<"\r"<<"***********      [ 55% ]";
    }
    if(i==11){
    cout<<"\r"<<"************     [ 60% ]";
    }
    if(i==12){
    cout<<"\r"<<"*************    [ 67% ]";
    }
    if(i==13){
    cout<<"\r"<<"**************   [ 75% ]";
    }
    if(i==14){
    cout<<"\r"<<"***************  [ 88% ]";
    }
    if(i==15){
    cout<<"\r"<<"**************** [ 100% ]\n";
}
}
  cout<<"\n\n\n"<<"Simulated Installation Complete\n\n";
  system("pause");
 return(0);   
}Actually have another question as well since playing with the \r. It seems that if I have a statement in an COUT asking for user input in a CIN, I cant find a way to make the COUT display the first question and user input as keyed and then clear that last question for a clean screen for the next user input unless I scroll the screen with a bunch of \n's. I was hoping I could double up on the \r's and have it clear out the prior line which was the COUT information in addition to the user input as displayed.

Currently the text displayed and user inputs unless I scroll with a bunch of \n's shows like this

Enter Integer # 1
3
Enter Integer # 2
5
Enter Integer # 3
8
The sum of your input integers = 16

Is there a way to clear without using system("cls"); and without scroling with cout<<"\n\n\n\n\n\n\n\n\n\n";

so you see the first input question and then upon entering your answer it clears up 2 lines to overlay fresh information in the place of the prior question. All other text displayed above it uneffected since you dont have to clear screen or scroll to remove the prior question?
There is no way to atomically clear the screen in C++; some libs seem to have a clrscr() function, but I keep getting unresolved externals when I try.

The REASON is C/C++ don't know that the standard input and output are really something that can be cleared. For example, consider the case where the output is being piped to a file- what should clearing the output device do?

Really, the only option is what you stated- a set of consecutive linefeeds.Thanks BC!  Figured I'd check in case there was a better way. Guess I will stick with the consecutive line feeds since I try to avoid system("cls");
79.

Solve : insert image file in c?

Answer»

how can i insert a IMAGE FILE IN C PROGRAMMING PLEASE SEND ME THE PROGRAMMING....../??
i need a 3d game as goood as oblivion so please send me programming.

oh YEAH and i forgot i need hot CHICK please send me programming ok. thanks Quote from: SURENDERSARSWAT on OCTOBER 02, 2011, 11:24:18 PM

how can i insert a IMAGE FILE IN C PROGRAMMING PLEASE SEND ME THE PROGRAMMING....../??


Code: [Select]INT main(char*[] ARGV, int argc)
{

//left as exercise for reader

}
80.

Solve : Connect VBapplication to Access database?

Answer»

Hello.

I am doing an college assignment and I am just creating a practice program to help me gain experience and a better understanding of Visual Basic 6.0

It is to do with databases. The program I am creating is meant to connect to an access
database, some of the functions of the program allow you edit and add records to the database. I have created the interface and the code in VB and made a  DB table in Access.

But for some reason VB will only allow me to connect to Access 97 version of access. When trying to connect to Access 2000 or 2003 my program gets an error and cant continue. This means I can only connect VB to Access 97, this is problematic because once you have converted the DB to access 97 format your are unable to edit the database, which is a problem because the program requires you to edit and add to the database.

So I'm asking how to fix VB so it uses the latest version access (2003)

ThanksNormally you would dim a new adodb.connection object and then open the connection with the provider and the dataset name of the database.

Code: [Select]dim cn as new adodb.connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=fullpathtodbfile"

Also check that your VB version has all the service packs installed (SP6 is currrent) and that MDAC (Microsoft Data Access Components) is current [ver. 2.8]

Good luck. Thats not how I did mine (at least thats what I wasn't shown in College) I used the data control on the left hand side on put it on my form. I then changed the properties and connected it to the database files I had stored. It seems to connect fine when in Access 97 format and allows me to look through all the data.

Here is a picture for better understanding (it shows the data control and where it is connected)

Click here

Is this perhaps the reason why it will not connect to database 2003?

Also how do I check that the latest Service pack (for Vb) and MDAC are installed?

Thanks
There's no problem using a control to connect to the database as this binds the data to the control and saves you coding later on.

The VB version should be on the splash screen when VB loads, but for something a little less flashy, open VB-->Help-->About VB should pop up a screen with the info on versions.

For the MDAC version, check registry key: HKEY_LOCAL_MACHINE\Software\Microsoft\DataAccess\FullInstallVer

Also check Component Checker Tool

 

More likely your MDAC version is out of date, but you never know.I'm not sure I could find anything specific on the SP, and the MDAC seems to be up to date. Here is a picture anyway.

Click here


ThanksIt appears your MDAC is up-to-date, but the VB seems to never had service applied. Since MDAC also includes the JET driver, it would seem everything should be ok. I run VB6 SP6 on my other machine and have no problems accessing any database at any version level. Only difference is the other machine runs XP Pro.

The LACK of service on the VB could be the culprit as perhaps the control you're using has been updated. Best advice would be to keep your software up to date.

You might also write a simple program to open a database (Access 2003), execute a sql select statement, and display the results. Keep it simple by not binding the database to a control and see if you have any problems.

Good luck. I'm not sure how to go about updating my VB. Usually I get the average Windows updates but that does not apply to VB does it? There doesn't seem to be any options for updating in VB.

Quote

You might also write a simple program to open a database (Access 2003), execute a sql select statement, and display the results. Keep it simple by not binding the database to a control and see if you have any problems.

How would I go about doing this? I'm only an amateur so I don't know, I know how code works and how to apply it, I'm just not sure of the specific code to do this as Ive only connected it to a database through the properties.

Note: My Visual basic 6.0 and Microsoft Office 2003 (programs only) are free software that I get from Microsoft because I am a student at college...If that explains anything about the versions...There is a service pack AVAILABLE for VB6 available >here<.

I can't remember what it updates but it may help with your problems.Actually the above download if for the VB6 runtime only. The full download can be found at VB SP6 and it is quite large.

You might also give this a read as this may apply: PRB Error

Your best bet is still to upgrade VB to SP6.

Good luck.  Well I downloaded the Service pack 6 but I'm not sure where to extract the files to. I extracted the files to Microsoft Visual studio folder in then program files but it appeared to have no affect and I still got the error message. The instructions were on the same page as the download:

Quote
Instructions


    * Before starting the download, create a download directory on your computer. If your internet connection is less than 300K, it is recommended that you run the multi-part download by following the "More Information" link at the upper right, then clicking "Download Now."

    * Click "Download" to begin downloading the single download. When prompted by the download software, choose the option "Save this program to disk" and click OK. Then select the directory you created on your computer.

    * Run the file from the download directory. When prompted, select the same directory you created on your computer. You will be expanding the contents of the EXE into this directory.

    * Run SetupSP6.exe from the download directory. When you accept the TERMS of the electronic End User License Agreement (EULA) the setup software will replace the appropriate files in your Visual Basic 6.0 installation.

You also mention Visual Studio. You can upgrade the studio programs with the update located at Visual Studio SP6

I may have forgotten to mention that in your project you will need to create a reference to Microsoft ACTIVEX Data OBJECTS 2.8 Library and Microsoft ActiveX Data Objects Recordset 2.8 Library. You do this from the Project drop-down menu.

Good luck.

Yes but the instruction where not fully specific. I ran the install and it does not install the files for you, it asks you to choose a directory with the files in, in which to extract to, so I extracted them to the Visual studio folder in Program files.

But Visual Basic 6.0 is part of the Visual studios package...

Could you tell me the folder I should extract the files too? it should be program files right?After the download, run the file just downloaded: VB6SP6B. This unpack the file into a set of component files. (You can use the same directory you used for the download)

Then run the setupSP6 application file to do the actual update. After you accept the EULA, the update will run.

When complete, open up VB and check Help==>About which should now mention that SP6 was applied.

Hopefully this should fix your problem. If not please post back with the exact error message you get.

 

*censored* when I click setupSP6  I get an error message. I have made a picture of the error message.

Click hereI've got to remember to ask the basic questions in the beginning, but what OS are you running? There are two setupsp6 files in the package. One has a lst extension, the other a exe extension. You need to double click the exe file from within Windows Explorer.

Do not try to run the setup file from the cmd or command environment. What update did you finally decide on, Visual Studio SP6 or Visual Basic SP6?

81.

Solve : Easy one (probably)?

Answer»

Okay I know pretty MUCH zero about vbs just to give you some background. I found this code on another forum and it does pretty much exactly what I need except for it echos the hostname of a pc in a pop-up box. I need it to write a line (this is going inside an HTA file). Here's the code:

Code: [Select] Option EXPLICIT

Dim WSHShell
Dim objNTInfo
Dim GetComputerName

Set objNTInfo = CreateObject("WinNTSystemInfo")
GetComputerName = lcase(objNTInfo.ComputerName)

Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.Popup(GetComputerName)

WScript.Quit

Just reading AROUND online a bit I'm guessing I need to use ".write" somewhere or other but I can't quite figure it out. HTA's are a COMBINATION of HTML code and script code that runs under an interpreter (mshta.exe) and needs no browser.

I changed your code a bit, wrapped it in a HTML SKELETON, and it's about as ugly as you can get; but it does what you requested in your post.

Code: [Select]<html>
<!--
-->
<head>
<title>HTA Test</title>
<HTA:APPLICATION
ID = "HTA Test"
  APPLICATIONNAME = "Application Name"
>
</head>

<SCRIPT LANGUAGE="VBScript">

Sub Window_onLoad()
Dim WSHShell
Dim objNTInfo
Dim GetComputerName

Set objNTInfo = CreateObject("WinNTSystemInfo")
GetComputerName = lcase(objNTInfo.ComputerName)
DataArea.InnerHTML = getcomputername
End Sub

</SCRIPT>

<body>

<span id=DataArea></span>
</body>

For more info on HTA's, check out the HTA Development Center

Good luck.


82.

Solve : delphi cdrom?

Answer»

I am a beginner with delphi and i need somme help.I need a procedure to detect my FIRST cdrom DRIVE , SOMETHING to CHECK if EXISTS a unique  file to a specific location .

83.

Solve : Batch Log file check points?

Answer»

I have created a log file that will automatically backup by overwriting.  How would I enhance it to backup up for five days, (Mon-Sat) and then, depending on the day it was executed, automatically backup to that specific folder?

 ALSO, how do I script check points that will log if the backup start & end were successful, failed, or cancelled? I already have the script that will successfully create a start and end entry which INCLUDES %day%, %time% and %computername% to a specific directory.


ThanksDepending on your OS something like this may work:

SET dow=%date:~0,3%

%dow% should then be set to day of WEEK which you can use in your logic to point to the appropriate folder.

As for part 2 of your question, consider checking errorlevels and outputting appropriate MESSAGES. Be aware not all programs issue errorlevels.

  Quote from: Sidewinder on April 07, 2007, 07:01:37 AM

Depending on your OS something like this may work:

set dow=%date:~0,3%
No, it depends on your time layout/format.
For example (win xp):
1. Go to Control Panel
2. Open Regional and Language settings
3. On the Regional Options tab, click Customize
4. Click on the Time tab
5. there is a 'time format' drop down menu. If that changes, so will what time say in Command Prompt.
84.

Solve : For my fellow newbies?

Answer»

These sites along with this one have been very helpfulin my quest to learn to program with out actually GOING to school for it.
http://library.thinkquest.org/22447/pas02.htm
http://www.programmingbasics.org/
http://pine.fm/LearnToProgram/?Chapter=00
http://www.freenetpages.co.uk/hp/alan.gauld/
http://forums.devshed.com/beginner-programming-16/a-highly-opinionated-review-of-programming-languages-for-the-novice-235831.html

A web search and some sifting through general rubish will turn up more info.  Good to see that you are willing to help others!I SELF taught myself batch and java and IM learning c++ with tutorials and examples and stuff.I'm slowly teaching myself batch with:
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx?mfr=true

And also this site.Looks LIKE some good resources for programming. Thanks for sharing the links.

Blood_ninja your question was a NEW question. It will be better to ask it in a new post so I split you off this topic.

85.

Solve : Help needed in making a program or any batch file?

Answer» HI All, I am new to making C or C++ programs.

Situation is that we have a word file of 7 lacs rows. In the file, simple commands of dropping indexes and then recreating them again is there. Most of the indexes are getting recreated. I need to find such indexes which are getting dropped but not getting recreated. sample of the concerned word file is as follows -

---------------------------------------------------------
DROP INDEX DATABASE.PS_SCON_ATT_LNG
;
COMMIT
;
CREATE UNIQUE INDEX DATABASE.PS_SCON_ATT_LNG ON PFPRGP.PS_SCON_ATT_LNG
 (SETID,
   CNTRCT_ID,
   LINE_NBR,
   SCHED_LINE_NBR,
   FILE_EXTENSION,
   DOCUMENT,
   LANGUAGE_CD) USING STOGROUP PRDGROUP PRIQTY 48 SECQTY 720 CLUSTER
 BUFFERPOOL BP2 CLOSE NO
;
COMMIT
;
DROP INDEX DATABASE.PS_SCON_COMPTTRS
;
COMMIT
;
CREATE INDEX DATABASE.PS_SCON_COMPTTRS ON PFPRGP.PS_SCON_COMPTTRS
 (SETID,
   CNTRCT_ID,
   LINE_NBR,
   SCHED_LINE_NBR,
   COMPETITOR_CD) USING STOGROUP PRDGROUP PRIQTY 48 SECQTY 720 CLUSTER
 BUFFERPOOL BP2 CLOSE NO
;
COMMIT
;
DROP INDEX DATABASE.PSASCON_CUST_CGRP
;
DROP INDEX DATABASE.PS_SCON_CUST_CGRP
;
COMMIT
;
CREATE UNIQUE INDEX DATABASE.PS_SCON_CUST_CGRP ON
 PFPRGP.PS_SCON_CUST_CGRP (SETID,
   CNTRCT_ID,
   SOLD_TO_CUST_ID,
   CUSTOMER_GROUP) USING STOGROUP PRDGROUP PRIQTY 48 SECQTY 720
 CLUSTER BUFFERPOOL BP2 CLOSE NO
;
CREATE  INDEX DATABASE.PSASCON_CUST_CGRP ON PFPRGP.PS_SCON_CUST_CGRP
 (SETID,
   SOLD_TO_CUST_ID) USING STOGROUP PRDGROUP PRIQTY 48 SECQTY 720
 BUFFERPOOL BP2 CLOSE NO
;
COMMIT
;

-------------------------------------------------------------------------------------------------

Can anyone help me with any program or BATCH file which can find such indexes which are getting dropped and not getting recreated
Or any way to create such batch file ??

Kindly help...

Thanks in advance.

Anshu.There is a REPLY to this question on the DOS board. Please do not double post, it causes much confusion and gets the natives very restless.

86.

Solve : Is WScript,vbscript, and cscript hybrid type's of BATCH????

Answer»

Was checking out some lead's and found some stuff about making "SCRIPT"!

So had to check it over!

It look's as if it has alot of simularity to BATCH .

Don't know for sure myself so thought I would post and see if someone
new anything about SCRIPT and the different thing's I could do with it...

Know how to saveas like in a batch file...and to give it the "name.vbs" when
saving the script file.

But what else can be done with them?
Anyone have some example's for me?

CScript is the command line version of Windows Script Host (WSH) and WScript is the GUI version. Batch uses command.com or cmd.exe to interpret and execute files with a .bat extension. CScript and WScript are the interpreters for VBScript and JScript  files running under the Windows Script Host. Other languages can be added into WSH.

About the only thing  in common between batch files and either vbscript files and jscript files is that they all can accomplish some work. VBScript and JScript can create and utilize COM and ActiveX objects where batch files have only limited communication with Windows. VBS and JS also have limited access to the .Net Framework. Batch language was developed during DOS days  and has never been Microsoft's first choice for a scripting language. Microsoft later settled on VBA. (IBM's first choice was REXX for PC-DOS7 and OS/2 which had been ported from their mainframe product line (VM/CMS).

Generally you pick a language based on what you need to do and what you already know or are willing to learn. All script languages (Python, Perl, VBScript, JScript, Rexx and probably hundreds of others) have their stong points and their not so strong points.

Microsoft has also released Powershell which is closely tied to the .Net Framework. It's very powerful but has a rather steep learning curve compared to some of the other languages. One nice thing is you can send whole objects thru the pipeline as opposed to just text with batch code.

I found this example of a VBScript in the snippet closet. It simply goes to the internet, grabs a new hosts file and installs it on an XP machine.

Code: [Select]
        Const ForWriting = 2
        Const TristateUseDefault = -2
        Const OverWrite = True

        Set objIE = CreateObject("InternetExplorer.Application")
        Set fso = CreateObject("Scripting.FileSystemObject")

        objIE.Navigate("http://www.mvps.org/winhelp2002/hosts.txt")
        Do Until objIE.ReadyState = 4
                WScript.Sleep 100
        Loop
        objIE.document.parentwindow.clipboardData.SetData "text", objIE.document.body.Innertext

        Set f = fso.GetFile("c:\windows\system32\drivers\etc\HOSTS")
        If f.Attributes = f.Attributes AND 1 Then
                f.Attributes = f.Attributes XOR 1
        End If

        If f.Attributes = f.Attributes AND 2 Then
                f.Attributes = f.Attributes XOR 2
        End If

        If f.Attributes = f.Attributes AND 4 Then
                f.Attributes = f.Attributes XOR 4
        End If

        Set ts = f.OpenAsTextStream(ForWriting, TristateUseDefault)
        ts.Write objIE.Document.ParentWindow.ClipboardData.GetData("text")

        f.Attributes = f.Attributes XOR 1
        f.Attributes = f.Attributes XOR 2
        f.Attributes = f.Attributes XOR 4

        ts.Close
        objIE.Quit
        Set objIE = Nothing

Good luck. THANK's Sidewinder I have been triing to learn all the program's that work
with my system that are already their and how I can use them more usefully......but the history on it help's understand alittle more

Have any example's I could toy around with so I can get to know how to use it better .......... more of an advanced learning stage.

I'm still learning batch,DOS, and script so i'm limited on knowledge ....
alway's triing to step up and learn more with programming in any form!

I  have been told that Batch and DOS aren't really programming language's
so I think I did to focas on c,c++, and Pascal !

Worked alittle with them just not enough to get a good start on understanding yet how to setup everything to make a program work right!Ok so what 's this mean that it's going todo in lame term's ................."grabs a new hosts file and installs it on an XP machine."

Before I run it .

That way I will no what to expect!!!

Remember i'm new to alot of this stuff!
So don't quit get what some of it mean's but can and want to learn!
Some people will make the case that batch language is a scripting language but in REALITY it's really a command language that originally came with DOS and now shows up with Windows, usually with some small UPDATES to handle new features of the operating system.

The scripting languages (VBScript, JScript, Python, Perl, Rexx and all the others) are text files that need an interpreter to run; usually supplied with each language. If any changes are made to scripts, they need only to be re-run for the changes to take effect. Generally scripts are faster to write and easier to maintain than full blown programs. On the downside, they tend to run slower than full blown programs.

Programming languages (C, C++, Pascal, VB, and all the others) start out as text files that get compiled and linked. If a change is made, the entire cycle of compile and link must be repeated.

The sample VBScript grabs a hosts file from the internet. The hosts file is the first line of defense your browser checks for off-limit sites. Generally porn sites or known sites for malware, if the address you're trying to connect with has an entry in the hosts file, the browser will reroute the request back to your system with a page displayed it could not find the site. The http://www.mvps.org/winhelp2002/hosts.txt is a good source for a hosts file, but it's updated EVERY two weeks or so. The script goes to the site, selects the host file text, copies it to the clipboard, writes out a new hosts file from the data on the clipboard and flips a few file attributes to hide and make it read-only. Many people do not use a hosts file, but if there are underage children using the computer, a hosts file is one way to prevent kids from viewing inappropriate sites (it's also free).

 Ok so how do you undo the host file for parent's search on everything..
Undo what you just did if it cause's conflict's with the system....I can't imagine the hosts file causing any conflicts unless you're trying to get into some dodgy sites. In any case the hosts file shipped with Windows consists of some comments and a single active line.

You could either write code to RECREATE the original file from scratch, or save the original file. By using an external parameter passed at run time you could decide whether to restore the original file or to get a new one from the net.

There are many ways to do most things when either scripting or programming. You are limited only by your imagination.
 
I suggest search for the script56.chm on your system. It is the compiled help file for VBScript and Jscript and defines all the methods and properties you can use when developing your scripts. Also check out The Script Center for the many tools and examples.

Good luck. Sidewinder thanks for the info.
Alot of this is new to me so I alway's like having a way to undo something
befor I try it out just incase it does cause conflict's with other program's.....
not saying it will of course!
But I have learned one thing from playing around with batch,asm,script and
some other's is that you should alway's find out what all a script, is going todo and how you can undo it .....just incase you turn of a function you need to access your internet account and yes that has happened to me......
that's when I decided to learn all I could!

But really thank's for the info and sorry I didn't get to reply sooner !

87.

Solve : MAPI SEND MAIL QUERY?

Answer»

Hi All ,

Can anyone help me reagrding MAPI send mail logic as soon as poosible.


I am supposed to get the SMTP server name from an ini file and have to send a mail through this server name.
 The syntax for getting the server name is :

mapird.lpszAddress = "";
QUOTES are required here

it should fetch the server name from an ini file.this is wat i gave in the ini file:

SMTP Server Name=SMTP:[email protected]

I fetch SMTP:[email protected] part from the ini file and store it in a variable named str using VC++.Now i call this variable str like given below:

mapird.lpszAddress =str;

This gives me a error like this:

error C2679: binary '=' : no operator defined which takes a right-hand operand of TYPE 'class std::basic_string,class std::allocator >


Please help me what to do.Im writing a code to send a mail from VC++.also let me know if i can find any other code where i DONT have to hardcode the server name.

Thanks a lot in advance,
Tika




The example cited here should help.

Good luck. thanks!!!

this s wat we too have done but now the prob is we should send mail THRUGH SMTP in C++. have any idea on this???

if so pls help???

88.

Solve : Comparing Date Values between Excel and Access (ADO)?

Answer»

Is there a simple way to MAKE identical the date format between EXCEL and Access ... i'm assuming there must be, but I can't seem to figure it out.

Basically, I need to take 2 Dates from Excel and 1 from an Access DB, and check them against each other... and if it passes, the record will be copied ONTO the Excel Worksheet.

Can anyone give me advice on how to get started with this... thank you~dteTo is a Short-Date formatted cell in Excel
datess is a field in Access

dteTo = Range("D28").Text

(1)
strQuery = "SELECT * FROM testTable1 WHERE datediff( ""d"", datess, ""02/02/2007"") = 0;"

(2)
strQuery = "SELECT * FROM testTable1 WHERE datediff( ""d"", datess, dteTo) = 0;"

1st one is ok, error for the 2nd one - 'No value given for one or more required parameters'

Someone pls help identify what is going on here... thank you~
This one of those problems where you know something is wrong but just can't see it. Actually I'm suprised example 1 worked, date literals are usually surrounded by # signs.

Quote

dteTo is a Short-Date formatted cell in Excel

I'm pretty sure the datatypes are mismatched and that by using the text property, something got messed up.

Try using dteTo = Range("D28").Value

You might try using Range("D28").Value directly in the DateDiff function or as a last resort using the CDate function to guarantee all the FIELDS are converted to dates.

Good luck.

PS. VB and VBA are not very forgiving when it comes to mismatched datatypes.

89.

Solve : Class Vs Structure in CPP?

Answer»

It is said dat class and structure are same in CPP. But, does structure can also have ABSTRACTION, encapsulation, inheritance, polymorphism as well... (please NOTIFY if any notion about union and enum in this)...  The DIFFERENCE is that members of a class are private by default, but members of a STRUCT are public by default. inheritance between classes is private by default, and inheritance between STRUCTS is public.


There are some other differences, but google is a rather simply tool to use.

90.

Solve : Calling an application in ASP2.0 using c++ and other things?

Answer»

How would I run an APPLICATION in an asp2.0 page using C++ as the code behind TYPE such as ipconfig?

Also does anyone know of a way to get the ipconfig, nslookup, and tracert INFORMATION from another computer, CURRENTLY if I try and access it using my computer it returns the localhosts information ie. my computer instead of the target computer.

Any information or suggestions would be greatly appreciated.

91.

Solve : C++ fork() function?

Answer»

I'd like to be able to do a fork() as an exercise for future reference if I need it. Examples on the internet have it similar to this:

Code: [Select]#include <iostream>
#include <sys/types.h>
#include <unistd.h>

using namespace std;
pid_t pid;

int main()
{
    switch(pid = fork())
    {
    case -1:
        cerr << "Fork failed\n";
    case 0:
        cout << "In child process.\n";
    default:
        cout << "In parent process.\n";
    }
    RETURN 0;           
}
I'm getting a compile error:

`fork' undeclared (first use this function)

I have read that it's supposed to be defined in unistd.h, but it doesn't seem to be. What am I (are they?) doing wrong?


Also, I have a question: If I make a pointer to a class, but initialize it to 0, have I allocated memory for just the variable, or the whole class? If I have a class BeachBall and have this code:

BeachBall *theBall;
theBall = 0;

Did I make a BeachBall, or just a pointer of type BeachBall? It's the difference between 4 bytes and roughly 32, so it means something to me.
I can't help you there as I don't know about the fork function. CHECK the header file to see if it's in?


I am 95% certain that no class is created (and THEREFORE no memory taken up) until you get to the new KEYWORD. So you've used memory for a pointer, but not a class yet.

92.

Solve : Escape game -- new thread?

Answer»

New programming methods; new thread warranted.

I've taken Neil's advice and written a small file parser. This will allow for cleaner code in the .cpp file itself, and players can mod the dialog a little if, for some reason, they want to. Right now the parser has full functionality and can get through any properly formatted text file.

Now, back to the programming... I don't understand this. It's really starting to piss me off. I'm trying to make a Door class, and something I'm doing is pissing off the compiler. I've tried it command by command...

First, I make this:

class Door
{
public:
    Door();
    ~Door();
};

and use this:

Door::Door()
{
}

Door::~Door()
{}

This compiles.

Slowly, I add things, compiling every time. (I have other classes, but they are currently commented out.)

Finally, it looks like this:

class Door
{
public:
    Door();
    ~Door();
    bool getLocked() const { RETURN isLocked; }
    void setLocked(bool x) { isLocked = x; }
    bool getClosed() const { return isClosed; }
    void setClosed(bool x) { isClosed = x; }
    USHORT* getCode() { return lockCode; }
    void setCode(USHORT x[4]){ for(int i = 0; i < 4; i++) { lockCode = x; }
private:
    bool isClosed;
    bool isLocked;
    USHORT lockCode[4];
};


Compiles.

Then, I add an enumerated variable:

enum DOORTYPE { STANDARD, STANDARD_LOCKED, CODE_LOCK };

class Door
{
public:
    Door(DOORTYPE x);
    ~Door();
    bool getLocked() const { return isLocked; }
    void setLocked(bool x) { isLocked = x; }
    bool getClosed() const { return isClosed; }
    void setClosed(bool x) { isClosed = x; }
    USHORT* getCode() { return lockCode; }
    void setCode(USHORT x[4]){ for(int i = 0; i < 4; i++) { lockCode = x; }
private:
    bool isClosed;
    bool isLocked;
    USHORT lockCode[4];
};


Implementation of

Door::Door(DOORTYPE x)
{
    isClosed = true;
    isLocked = true; //Testing, will add if logic later.
}

Door::~Door()
{}

This will NOT compile; I get 15 errors. But read some of these errors:

58 escape.cpp `Door::Door()' and `Door::Door()' cannot be overloaded
66 escape.hpp `isLocked' undeclared (first use this function)

escape.hpp In member function `void Door::setLocked(bool)': isLocked' undeclared (first use this function)

I think to myself: Oookay, there MUST be an error in the DOORTYPE. Logical assumption. So I remove all references to DOORTYPE. I compile... and get the same errors!

I remove all code from the constructor... same result.

Here's the full body of uncommented code:

Code: [SELECT]//Escape.hpp
typedef unsigned short int USHORT;
enum DOORTYPE { STANDARD, STANDARD_LOCKED, CODE_LOCK };

class Door
{
public:
    Door(DOORTYPE x);
    ~Door();
    bool getLocked() const { return isLocked; }
    void setLocked(bool x) { isLocked = x; }
    bool getClosed() const { return isClosed; }
    void setClosed(bool x) { isClosed = x; }
    USHORT* getCode() { return lockCode; }
    void setCode(USHORT x[4]){ for(int i = 0; i < 4; i++) { lockCode[i] = x[i]; }
private:
    bool isClosed;
    bool isLocked;
    USHORT lockCode[4];
};
Code: [Select]//Escape.cpp
//Includes
#include <iostream>
#include <ctime> //time() <--Delays, RNG
#include <cstdlib> //srand() and rand()
#include <string>
#include "escape.hpp"

//Macros
#define SET_RANDOM_CODE \
srand (time(NULL)); \
USHORT r; \
for(int i = 0; i < 4; i++) \
{ \
    r = rand()%999; \
    r /= 100; \
    code[i] = r; \
}

//Using
using namespace std;

//Global Variables, soon to be replaces in a Player class...
string input; //Player's reply
ROOM location; //Player's location

Door::Door(DOORTYPE x)
{
    isClosed = true;
    isLocked = true; //Testing, will add if logic later.
}

Door::~Door()
{}

int MAIN()
{
    return 0;
}The errors I get:

58 C:\Documents and Settings\Timothy\My Documents\CPP\C++\source\Escape\escape.cpp `Door::Door()' and `Door::Door()' cannot be overloaded

62 C:\Documents and Settings\Timothy\My Documents\CPP\C++\source\Escape\escape.cpp `Door::~Door()' and `Door::~Door()' cannot be overloaded

110 C:\Documents and Settings\Timothy\My Documents\CPP\C++\source\Escape\escape.cpp expected `}' at end of input

 C:\Documents and Settings\Timothy\My Documents\CPP\C++\source\Escape\escape.hpp In member function `bool Door::getLocked() const':

66 C:\Documents and Settings\Timothy\My Documents\CPP\C++\source\Escape\escape.hpp `isLocked' undeclared (first use this function)

 C:\Documents and Settings\Timothy\My Documents\CPP\C++\source\Escape\escape.hpp In member function `void Door::setLocked(bool)':
67 C:\Documents and Settings\Timothy\My Documents\CPP\C++\source\Escape\escape.hpp `isLocked' undeclared (first use this function)

 C:\Documents and Settings\Timothy\My Documents\CPP\C++\source\Escape\escape.hpp In member function `bool Door::getClosed() const':

68 C:\Documents and Settings\Timothy\My Documents\CPP\C++\source\Escape\escape.hpp `isClosed' undeclared (first use this function)

 C:\Documents and Settings\Timothy\My Documents\CPP\C++\source\Escape\escape.hpp In member function `void Door::setClosed(bool)':
69 C:\Documents and Settings\Timothy\My Documents\CPP\C++\source\Escape\escape.hpp `isClosed' undeclared (first use this function)

 C:\Documents and Settings\Timothy\My Documents\CPP\C++\source\Escape\escape.hpp In member function `USHORT* Door::getCode()':
70 C:\Documents and Settings\Timothy\My Documents\CPP\C++\source\Escape\escape.hpp `lockCode' undeclared (first use this function)

 C:\Documents and Settings\Timothy\My Documents\CPP\C++\source\Escape\escape.hpp In member function `void Door::setCode(USHORT*)':
71 C:\Documents and Settings\Timothy\My Documents\CPP\C++\source\Escape\escape.hpp `lockCode' undeclared (first use this function)

72 C:\Documents and Settings\Timothy\My Documents\CPP\C++\source\Escape\escape.hpp expected primary-expression before "private"

72 C:\Documents and Settings\Timothy\My Documents\CPP\C++\source\Escape\escape.hpp expected `;' before "private"

72 C:\Documents and Settings\Timothy\My Documents\CPP\C++\source\Escape\escape.hpp At global scope:

110 C:\Documents and Settings\Timothy\My Documents\CPP\C++\source\Escape\escape.cpp expected unqualified-id at end of input

110 C:\Documents and Settings\Timothy\My Documents\CPP\C++\source\Escape\escape.cpp expected `,' or `;' at end of input NOOO...

Ignore previous two posts...

This line was the culprit:

    void setCode(USHORT x[4]){ for(int i = 0; i < 4; i++) { lockCode = x; }

I AM MISSING A BRACKET!!!

This compiled fine:

    void setCode(USHORT x[4]){ for(int i = 0; i < 4; i++) { lockCode = x; } }

I'm leaving this here as a testament to how one character can cause tons of mistakes. Haha welcome to the wonderful world of C++! This is why trying to squeeze everything onto 1 line is a bad idea Also when creating a new function, it's a good idea to create the skeleton for it first (the tabs, {}, etc) then fill it in, as not to forget anything.I originally wrote it as multiple lines, then I compressed it. I guess I struck that Delete key one too many times. I normally don't condone double-posting, but as I may have updates any time, I feel it acceptable in this thread.

The bare MINIMUM code required to create the bedrooms of my house is complete. Using aggregation, I have four true OOP rooms. All 145 errors (another bracket or two missing) fixed, and that is complete. Next, I write the story for the first room. Which means moving my text file parser into this program (that'll be fun...).

EDIT: File parser is implemented. The ideas for a command parser are being drawn up, too. I believe I have written the most important piece of code in the program -- and it's only about 8 working lines.

Code: [Select]void parseFile(string begin, string end) //Within selected header, output contents
{
    string parser;
   
    ifstream fin("escape.dialog");
    fin.seekg(0, ios_base::beg); //Just to be safe, put the parser at the beginning
    while(parser != begin) //Search for the first tag
    {
        getline(fin, parser);
    }
    //Start tag is in parser right now.
    //Output text to the screen until the end tag is reached
    for(getline(fin, parser); parser != end; getline(fin, parser))
    {
        cout << parser << endl;
    }
    //End tag is in parser now.
    //Doesn't matter; the variable is destroyed now.
    fin.close();
}
The comments about what is in the variable are only there to cement my understanding of what's going on in my program's code. I'm not inept, really.

I tested this, passing "#INTRO" and "#END_INTRO" as arguments. The contents of escape.dialog are:

Quote

Sample comment; nothing outside of header tags are used.
#INTRO
Welcome to Escape by Timothy Bennett.
The object of this game is to escape my house.
This is debugging filler to test the file parser.
#END_INTRO

Output:

Welcome to Escape by Timothy Bennett.
The object of this game is to escape my house.
This is debugging filler to test the file parser.

It's up and running!

I can safely say I've never written a for loop that way before. With the file parser down, it's time to work on the command parser.

The command parser will make figuring out the file parser look easy. The problem isn't so much writing the code as figuring out the best way.

In earlier attempts at this program, the room-specific commands were functions inside of the class the room was in. This made it easy to write a command function as I had direct access to the variables I needed to access. No accessor functions, no "returning a reference to an object" so I can manipulate a variable.

However, this may not be technically feasible anymore. Three instances will use the same class, SmallBedroom, so using that method I'd have to put the commands for timsBedroom in the same spot as sarahsBedroom in the same spot as -- well, you get the idea. I don't want to do that, because not only does that place undue importance on the enumerated ROOM, but it's unorganized.

The other strategy, which I'm starting to like more and more, is to put all parsers and command functions in a Command class. Public will contain the parsers; private will be the commands. That's a lot of functions for one class, but then it's out of the way.Cool. I am reading your posts but I've been too busy to make a decent reply to them.

How exactly are these commands going to work? I was thinking of something like the following, but more complicated. Create a dynamic number of event/scene classes containing an id number, a string for the description of the area, and a dynamic number of choices with a string for each choice and the destination id. Each event stored in the script has an id number, string description and a number of choices and destinations. For example, choice 2 is "go in second door" and leads to event id 7 (that room) or you could name each scene if that's more convienient. That's a simplification of the way I would do it. Is this similar to the way you are planning to do it?If the house in question were large, I'd do something very close to that. (Or maybe I am; I didn't follow you 100%.) If you were saying that the user pick from a menu of available options, then that is something I would gladly do if this game were much larger. As it is, it's not very large(!), so it's going to be somewhat of a throwback to the old command-line games, where the user enters a string of text, such as "take item". An example of an online form of this game style can be seen here: http://thcnet.net/zork/

Of course, this requires a good deal of creativity on my part, making sure the parser accepts multiple variants of the same command. Even better, they could be in a file, allowing them to be edited without having to recompile the program. It's a matter of how much of the game I want to expose for editing. This, I feel, can be done.

Again, I wouldn't do this if there was any real difficulty in the game itself. It may have a few points, but I don't think so. (Then again, I'm writing this game and know exactly how to win. )Update:

Class-work for the first room is complete. File parser is complete; I'm working on the command parser. I'm noticing the downside of OOP. This game needs OOP, but how often can I type things like this and remain sane?

if(timsBedroom->getComputerDesk()->getLight()->inInventory == false)
{
    timsBedroom->getComputerDesk()->getLight()->inInventory == true;
    parseFile("#TAKE_LIGHT", "#END_TAKE_LIGHT", 1.5); //Delay getline for 1.5 seconds
}

As you can see, I'm using pointers for all my classes so I can delete them and set them to 0 as needed (each SmallBedroom instance has different classes, so this is required), but that means I'm eternally calling functions that return pointers to classes.

TO-DO LIST:

Finish first room
    1. Write command parsers
    2. Write command functions
    3. Write dialog

I'll worry about the rest of the game later. Try macros.

#define location timsBedroom->getComputerDesk()->getLight()->inInventory

I'm not sure if you can redefine marcos but if you can then just redefine location at the start of each section withs lots of repetitive object names.

You could even combine them.

#define area timsBedroom->getComputerDesk()
#define subarea getLight()

area->subarea->inInventory

#define subarea getBook()

area->subarea->inInventory
93.

Solve : Exceptions?

Answer»

Does anybody know where I can find a list of exceptions included naturally in C++? I know OutOfMemory is one of them. I've been looking on the net for a while now.

EDIT: Is this really all of them?

Quote

    * std::bad_alloc - thrown by the new operator when memory allocation fails.
    * std::bad_cast - as above.
    * std::bad_typeid - as above.
    * std::logic_error - base class for std::domain_error, std::invalid_argument, std::length_error and std::out_of_range.
    * std::domain_error - not sure what this is for.
    * std::invalid_argument - does exactly what is says on the tin.
    * std::length_error - thrown when container CLASSES get too BIG, such as APPENDING too many characters to a string.
    * std::out_of_range - thrown by the container classes when ACCESSING a value at the wrong index.
    * std::ios_base::failure - thrown when an IO operation fails.
    * std::runtime_error - base class for std::range_error, std::overflow_error and std::underflow_error.
    * std::range_error - thrown when internal range calculations fail - such as when using unrelated iterators.
    * std::overflow_error - thrown when a numeric value cannot get any LARGER.
    * std::underflow_error - thrown when a numeric value cannot get any smaller.
94.

Solve : I need to learn how to write C and C++ code!?

Answer»

:-?
I have been using several compiler's but my favorite one's are free!
Have a problem tring to do something's even with the tutorial help,
that they give me.....buy the way I am using the LccWin32 on windowsXP !
If anyone know's some trick's that I could use I would be grateful
for the help!
thing's I'm tring to do are:
1.add my own picture's
2.add my own sound FILE's
3.make a program without the window border,I guess it would be
a floating window that show's up in the midle of the screen!
4.how to put Assembly code in C or C++ program's.

I know i'm asking alot but as I learn I pass on to children that I teach for fun...

After all if you can't have fun learning something why learn it!!!

I figure that the answer has been at my finger tip's but i'm over shooting the target, I also have been tring to do this with a free
PASCAL compiler on windows XP with no luck! :-/

Please help soon IF YOU CAN someone...DS 8-)

Raptor I would like to thank you very much for all that info
maybe now I can read it and figure out some easy way's to
show the children how to make their game's from scratch and some other thing's they been wanting to do as well !

I really must say that the help I've been getting from this site
and the PEOPLE here has really been excelent...your all the best help I have had,and i'm glad I registered in this site to post question's and help for other's because it's helped me alot !!  

I have read some book's befor on c and c++ and even own a couple but it alway's seem's like something is MISSING on what i'm
looking for ...the c language info I don't have a book on and I needed that as a kind of cross reference for checking to see how
the usage on something's were different from other's so again thank's Raptor  

Start here: How C Programming WorksRaptor - welcome home - have you been vacationing in the Big House :-?

OK ! DOES ANYONE HAVE ANY TEXT NOTE'S AT HAND FOR DOING THIS AT HAND............SOME EXAMPLES FROM START THAT I COULD USE!!!!Turn off your caps lock button...Wait... you put batch file threads in Computer Programming... and C(++) threads in DOS?

For starting C/C++, I'd suggest clicking here for a variety of tutorials:

http://www.google.com/search?q=C%2B%2B+%7EtutorialYes .............I'm backward's it's a habit of mine to go brain dead and forget
what area i'm in at time's...but I get to thinking on something that I am working on and have to write about it or ask question's and post them wrong..... "SORRY"!

Thank's Dilbert for the link ......need to read up on C and C++ alot!!

The more it explain's thing's from start with Example's ......the more USEFUL it
is for me now!
I posted this here in hope's of actually finding out if you can call a
Batch program from inside of a C or C++ program!

But went astray from the question completely and asked the wrong stuff
here in this post !

95.

Solve : Q: Is DOS or Pyton able to handle IO com??

Answer»

Hi,

I'm not a programmer, but will wish to pickup some skills on handling and playing with IOs.
IO can be USB input and output signal or ETHERNET IO or parallel port IO.

If both of the above cannot handle the IO communication, anything i can start up with without spending much as a start?

It will be good if anyone can recommend me some good links which can guide me through from scratch.

Thanks and hope any expert can help...

what you want to do is QUITE low level and DOS is not suitable for the job. Other languages like Java/Perl/Python will somehow have modules which does the low level job for you. from the title, i guess you want to try Python. You can checkpyParallel outHi,

Thanks very much for your reply,
have read up the link you provided,
think its still early to get to know in details.
Currently still looking at the python lesson 2
http://www.developer.com/open/article.php/625911

Glad to HEAR python can handle the IO, as least i will not be in the wrong track.
As i have learn a little of dos and found there is limitation to my needs, so have to pickup python now.

i suggest you go through this site, ESPECIALLY the tutorial, by Python's creator himselfOk, started to read them up now.
Btw, do we have Phyton Q and A in this forum for Phyton?
I have learn a lot from the example that people post and answered for DOS,
that make me understand and get to work out the DOS batch file very fast.

Really hope there will be a Pyton Q and A forum just like the DOS.

Thanks...Hmm.. have read up a few pages, think the language is not simple, don't really understand that he say..
Think i probably follow the old tutorial before i come to this.

Thanks anyway.which part you don't understand. you can ask here. the people here will help if they can.Most of them are those programing jargon.
I will make some effort to read more before asking very silly question.

Hmm... this is the good thing about forum, will not FEEL like doing it alone,
coz people here very helpful... =) Thanks...

96.

Solve : Batch File help getting drive letter?

Answer»

I need help trying to get just the Drive letter in  batch files.
So far the best I can come up with is this
REM get CURRENT location
set origdir=%cd%
REM get to root of the drive and save that location
cd\
set odrive=%cd%
REM return to original location
cd %origdir%
REM strip :\ off the current drive
if %odrive%==A:\ set odrive=A
if %odrive%==B:\ set odrive=B
if %odrive%==C:\ set odrive=C
if %odrive%==D:\ set odrive=D
if %odrive%==E:\ set odrive=E
if %odrive%==F:\ set odrive=F
if %odrive%==G:\ set odrive=G
if %odrive%==H:\ set odrive=H
if %odrive%==I:\ set odrive=I
if %odrive%==J:\ set odrive=J
if %odrive%==K:\ set odrive=K
if %odrive%==L:\ set odrive=L
if %odrive%==M:\ set odrive=M
if %odrive%==N:\ set odrive=N
if %odrive%==O:\ set odrive=O
if %odrive%==P:\ set odrive=P
if %odrive%==Q:\ set odrive=Q
if %odrive%==R:\ set odrive=R
if %odrive%==S:\ set odrive=S
if %odrive%==T:\ set odrive=T
if %odrive%==U:\ set odrive=U
if %odrive%==V:\ set odrive=V
if %odrive%==W:\ set odrive=W
if %odrive%==X:\ set odrive=X
if %odrive%==Y:\ set odrive=Y
if %odrive%==Z:\ set odrive=Z

I was hopeing there might be an easier way to just get the letter. I have tried a for command but being partly self taught I am haveing trouble getting the for command to work in tests.  Any help or simpler codeing for win XP sp2 would be most welcome.  REPLACE the whole line of IF statements with this:

SET odrive=%odrive:~0,2%Thank you  So Much I knew if i asked the right people or looked on the right web page I would get an easy answer . I have been banging my head agenst that problem for 2 days searching the net . I will be back when i NEXT get in trouble with my batch programingEasy? Nah, it took me a YEAR to learn that. You're welcome, by the way.

97.

Solve : CSript idea.?

Answer»

Dear All !!

Could anyone give me briefly idea about Cscript.

Thanks!CScript is the command line version of Windows Script Host (WSH). Actually among other subtle differences CScript allows access to the console STDIN and stdout devices and echoed OUTPUT is  sent to the console. WScript is the GUI version of WSH, has no access to console stdin or stdout devices and echoed output is sent to a window.

CScript generally offers more control over your script and is used MAINLY for administrative and event monitoring scripts.

 

CScripts that run AMOK can be canceled at the command line with ctl-C. WScripts that run amok need to be terminated from the Windows Task Manager.Ok,
Thanks n Regards,
Jay

98.

Solve : PLEASE HELP ME SOMEONE?

Answer»

hello my name is Cleo,

And i own a  i have a toshiba satalite 1410/2410 laptop
and am praying some body will help me as i know little about computers
mechanicals and am really F%^$%&ED without it PLEASE help me

And my problem is as follows:

recently i had to reset it back to the manafacturers cd that i got with the laptop,
as it was behaving oddly, It would boot up but then it would go to the blue screen where it states
your computer needs BLAH,blah,blah we recomend you dont skip the process etc, 10 second countdown.
but then i would take AGES b4 it reached the 100% checked part & then it would say something like erm.? fixing section
 whatever but it would then no go any further on than that.
now usuallyit would have gone to the black windows screen then the welcome screen then i could use it no problem , Anyway
as the pros out wayed the cons i decided to run my factory disc which i did & everything was ok there it said congratulations you have re installed the dic ok etc. but now it has fixed the problem with the blue screen and when it reaches the black screen
where it setting up windowshome edition it says please wait...... etc and then after a while i get a pop up saying
"The system is not fully installed please run the set up again ?

I can no longer get passed this point , i run the factory dic again but still the same its CRAZY PLEASE SOMEONE HELP..
i can get to the part where you can run safe mode from etc but even that does not help me i am lost as what to do now
so any help would be GREATLY appreciated as i use it constantly , well each day anyhow and im lost without it thankkkks in advance
Double post, the other one is here, in the Windows section, where I feel it is more appropriate as the problem is not related to programming.

99.

Solve : copied ntfs.sys now pc wont boot to desktop??

Answer»

I had a FILE missing a ntfs.sys so i put in my xp CD and copied it. when i was finished i took the cd out and exited and it REBOOTED. but i NOTICED that it had service pack 1 on there now not 2 and it wont go to DESKTOP but instead it keeps asking what mode i want to start windows in. I tried safe mode and normal mode and it still wont go to desktop. can someone plz help me?

100.

Solve : Plz Help on CD Protection?

Answer»

Hi All
I need Help
I wanna to protect my own CD or DVD from being copied;ie how can prevent my CD from being copied ;ie if I creat a CD & GIVE it to other person He can open it an USE it but he can not copy it to other CD
Please
with lots of thanks

Dr. AyadThis site might help you out...

http://www.cdmediaworld.com/hardware/cdrom/cd_protect_cd.shtmlI have not yet heard of a CD copy-protection method that hasn't been cracked.  Don't spend lots of money on something that promises to be UNCRACKABLE.  That will be nothing more than a sales puff.

If you want to protect the contents of that CD, you should think about other methods - e.g. watermarking images & music files; locking software with keys etc.Thank you very much Quote from: dr_ayad on March 24, 2007, 12:53:46 PM

Hi All
I need Help
I wanna to protect my own CD or DVD from being copied;ie how can prevent my CD from being copied ;ie if I creat a CD & give it to other person He can open it an use it but he can not copy it to other CD
Please
with lots of thanks

Dr. Ayad
?