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.

1201.

Solve : XML Data conversion help?

Answer»

Hello everyone,
I hope this is a good place to ask for help with this type of thing.
I am using an HP iPaq with WM5 and XSForms for an "in the field" data collection system. The data output of this program is XML, which gets transferred to my DESKTOP PC (XP Pro) at the end of the day. My problem is that I need the XML data to be converted into a viewable/printable format that allows me to view each location's data on its own page, instead of one long run of XML. I would also like something that can translate the header of each entry into a header instead of the under_scored_garble that is part of GETTING XSForms to work correctly.
I have searched extensively for a simple program that would allow me to perform these operations, and cannot find anything. I guess an XML to .doc conversion would probably suffice, but I seriously cannot find one that does what I am describing.
I am learning Java programming and would be happy to create a little app for this, but need a guru to work with me on it. I am new to Java and XML, so I'm a little in the dark and overwhelmed with all the options AVAILABLE. I don't know where to start a project like this. I am learning by using NETBEANS, which may or may not be the best choice for this type of thing. Any advice or SUPPORT would be greatly apprieciated.
Thanks!

1202.

Solve : passing a variable for CD in ftp script from RPG CL?

Answer»

Does anyone KNOW if it is possible to PASS a variable from an RPG cl to an FTP script for command CD?

Example:

My path is data_updates so the VALUE of variable &PATH is data_updates. I want to pass &PATH to the FTP command CD and CHANGE the directory to data_updates. Is this possible and how can I do it? I have tried and failed.

Thanks in ADVANCE

1203.

Solve : Email Software??

Answer»

Say I wanted to MAKE my own email server system (just for the *censored* of it. I love learning NEW THINGS.)

I'm assuming I'd need a server, which I have, and a DOMAIN, which I have.

If I wasn't to use the stuff OFFERED by Microsoft (or other people) for this exact purpose hwo would I go about making my own email system?

I know PHP, and html, and some Asp.Net

Any ideas?

1204.

Solve : Access Database - Search box?

Answer»

In an Access database, I have a form that, after the USER performs a search, displays the name of an employee, the parking tag #(s) that have been assigned to them and their phone extension. I'm using a search box (a combo box) on that form where the user can search using the Tag # to get the results mentioned above. A query showing all the employees and their related Parking Tag numbers is the DATA source used in the combo box. The combo box also has the following code in an After Update event procedure:

Sub Combo3_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[TagInventory#] = '" & Me![Combo3] & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub]


This works well when the user searches by the Tag number.

I'm trying to create a similar search box on another form but in this case the user can search by name. The above code doesn't work where an employee has 2 Parking TAGS assigned to them. How do I adapt the code or what other procedure can I use so that all the records are displayed when an employee has more than 1 Tag# assigned to them. What can be used in place of FindFirst or FindLast?

As always, thanks in advance for any assistance
So this table is unique by tag number and a PERSON can have multiple tags. Can you not run a query against the persons name?

Another APPROACH would be to use FindFirst, to get the first match, then use repetitive FindNext until the NoMatch property is true.

Good luck.

1205.

Solve : Turbo C?

Answer»

can SOMEONE give the CODE of Turbo C- Lexical Analyzer ( Data Structures ) ROLL Eyes You can try your LUCK with this link

Good luck.

1206.

Solve : unix script programming using awk?

Answer»

The awk script is invoked from the command line with an inputfile that contains data on products, associates and sales

My problem is printing the name array and the sales array at the same time. so far i got my program problem to print the same value in the name's array over and over again and the sales array WORK just fine. Also i want to sort the output from highest to LOWEST base on the sale's array

here's my code so far

Code: [Select]# !/bin/bash

# Adrien Jeffries
# Assingtment 8
# due 05-02-11
# Write an awk script that produces
# a report from an input file

BEGIN {
# printing header
print "Lazy Acres, Inc."
print "2010 Sales Associates Ranking"
print "Name Position Sales Amount"
print "=========================================="
# setting field separator to :
FS = ":"
}

# Product lines
# $1 = Product ID.
# $2 = Product Caregory
# $3 = Description
# $4 = Price
NF == 4 {
product[$1] = $4;
}

# Associates lines
# $1 = Associate ID.
# $2 = Name
# $3 = Position.
NF == 3 {
name[$1] = $2 ":" $3;
}

# Sales lines.
# $1 = Transaction ID
# $2 = Product ID
# $3 = Quantity
# $4 = Date
# $5 = Assoiciate ID
NF == 5 && $4 ~ /2010/ {
if ($2 in product) { sales[$5] += $3 * product[$2] }
}
END {
# Print out the report in descending order base on sale
asort(sales, salesSorted);

for (i = length(sales); i > 0; i--)
{
for (x in sales)
{
if (sales[x] == salesSorted[i])
{
for( y in name)
{
printf("%20s %18.2f\n", name[y], salesSorted[i]);
break;
}
}
}
}
}

here the inpute file that im using
Code: [Select]108:Maritime Accessories:wheel:49.99
109:Boating PART:transom:199.00
102:Boating Part:trailer hitch:97.95
103:Maritime Accessories:sway bar:49.99
110:Tackle:pulley:9.88
101:Boating Part:propeller:104.99
105:Tackle:mirror:4.99
111:Maritime Accessories:lock:31.00
104:Tackle:FISHING line:0.99
113:Tackle:fish bait:1.00
106:Tackle:cup holder:2.49
107:Maritime Accessories:cooler:14.89
112:Boating Part:boat cover:120.00

26:Miller, Dennis:Comedian
25:Lindon, Rosemary:Producer
23:Worker, Susan:Manager
21:Doe, John:Clerk
24:BUCK, Fast:Stock Boy
22:Rush, George:Salesman

237787:113:92:12/22/2008:24
291065:104:9:05/06/2010:26
845813:104:9:05/06/2009:26
152208:104:9:05/03/2008:21
585537:104:9:03/03/2008:21
193475:104:9:03/03/2008:21
810622:107:9:03/01/2010:21
173530:107:9:03/19/2009:21
484983:104:9:03/01/2008:21
151862:104:9:03/01/2008:21
366957:111:4:12/02/2008:21
491736:111:4:12/02/2008:21
910094:104:3:03/02/2009:24
265256:108:21:03/02/2010:22
893187:108:21:03/02/2009:22
220350:104:2:05/03/2008:24
631798:104:2:05/03/2008:24
571077:104:2:03/03/2010:24
332157:104:2:03/03/2010:24
104454:104:2:03/03/2010:24
# example of erroneous line
502930:104:2:03/03/2009:24
567394:104:2:03/02/2010:24
854164:104:2:03/02/2010:24
040140:104:2:03/02/2010:24
108022:104:2:03/02/2010:24
639395:106:2:03/02/2010:24
013111:106:2:03/02/2010:24
720184:104:2:03/02/2009:24
101814:104:2:03/02/2009:24
482945:104:2:03/02/2009:24
254355:105:2:03/01/2010:24
676697:105:2:03/01/2010:24
896782:110:2:03/01/2008:23
759895:110:2:03/01/2008:23
720292:110:2:02/02/2009:23
907622:109:12:03/01/2010:24
928610:109:12:03/01/2009:24
377662:104:1:05/03/2010:26
899755:112:1:05/23/2008:23
778879:109:1:03/03/2010:24
324254:104:1:03/03/2008:26
194231:104:1:03/03/2008:26
995552:104:1:03/02/2008:26
161296:104:1:03/02/2008:26

so my output to look like this


% awk -f z123456.rank inputfile
Lazy Acres, Inc.2010
Sales Associates Ranking
Name Position Sales Amount
==========================================
Buck, Fast Stock Boy 2630.78
Rush, George Salesman 1049.79
Worker, Susan Manager 360.00
Doe, John Clerk 134.01
Lindon, Rosemary Producer 31.00
Miller, Dennis Comedian 9.90

1207.

Solve : Inconsistent vb error?

Answer»

So I have an FTP client integrated into one of my VB6 programs. The function to send files through FTP is acting inconsistent and I think that it is a problem with VB.

This works:

Code: [Select]Private Declare Function FTPPutFile Lib "wininet.dll" Alias "FtpPutFileA" (ByVal hFtpSession As Long, ByVal lpszLocalFile As String, ByVal lpszRemoteFile As String, ByVal dwFlags As Long, ByVal dwContext As Long) As Boolean

Public Function SendFTPFile(sFile As String, sRemote As String) As Boolean
If FTPPutFile(hConnection, sFile, sRemote, FTP_TRANSFER_TYPE_BINARY, 0) Then
SendFTPFile = True
Else
SendFTPFile = False
End If
End Function


This doesn't work with a while loop:

Code: [Select]Private Declare Function FTPPutFile Lib "wininet.dll" Alias "FtpPutFileA" (ByVal hFtpSession As Long, ByVal lpszLocalFile As String, ByVal lpszRemoteFile As String, ByVal dwFlags As Long, ByVal dwContext As Long) As Boolean

Public Function SendFTPFile(sFile As String, sRemote As String) As Boolean
SendFTPFile = FTPPutFile(hConnection, sFile, sRemote, FTP_TRANSFER_TYPE_BINARY, 0)
End Function

When I use the code below, it only works when calling the first function even though the functions should do exactly the same thing. WHY? It doesn't make sense.

While Not SendFTPFile(...........) And i < tries
i = i + 1
WendYou imply that there are errors....

but you NEVER mention them outside the subject. What I mean is that the second function appears to return true (using the built in vb debugger), but the while loop I posted goes until i = tries even if the SendFTPFile function returns true every time. The while loop does work with the first function though, which SHOULD do exactly the same as the second. So what I am asking is why doesn't the second function work the same way as the first?Quote from: Linux711 on May 01, 2011, 09:29:14 PM

So what I am asking is why doesn't the second function work the same way as the first?

FTPPutFile doesn't return a boolean- it returns a BOOL, which in the WINDOWS headers is actually an int; additionally, it actually returns 1 for true, and 0 for false; whereas Visual Basic uses -1 for true, and 0 for false. This can cause some problems when you try to mix them around. You could either return a boolean expression LIKE this:

Quote
Private Declare Function FTPPutFile Lib "wininet.dll" Alias "FtpPutFileA" (ByVal hFtpSession As Long, ByVal lpszLocalFile As String, ByVal lpszRemoteFile As String, ByVal dwFlags As Long, ByVal dwContext As Long) As Long

Public Function SendFTPFile(sFile As String, sRemote As String) As Boolean
SendFTPFile = (FTPPutFile(hConnection, sFile, sRemote, FTP_TRANSFER_TYPE_BINARY, 0)<>0)
End Function

Or you could use CBool() on the return value of FTPPutFile when returning it from the function, or just use the method you did and use an If. In any case, the inconsistency is most likely because of the fact that the function declared doesn't return a OLE Boolean value but rather a Long Integer and VB was interpreting it incorrectly as a RESULT.
1208.

Solve : NMAKE fails repeatedly fails.?

Answer»

I'm trying to install wxWidgets 2.8.12 into Microsoft Visual C++ 2010. Whenever I use nmake -f makefile.vc (exactly as in \build\msw\install.txt), it fails repeatedly with ERROR code 0xc0000135.

Prompt:

Code: [Select]Microsoft Windows [Version 6.0.6002]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.

C:\Windows\system32>cd C:\wxWidgets*\build\msw

C:\wxWidgets-2.8.12\build\msw>nmake -f makefile.vc

Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.

cl /c /nologo /TC /Fovc_mswd\wxregex_regcomp.obj /MDd /DWIN32 /Zi /Fd..
\..\lib\vc_lib\wxregexd.pdb /D_DEBUG /Od /I..\..\include /I..\..\lib\vc_lib\m
swd /D__WXMSW__ ..\..\src\regex\regcomp.c
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\bi
n\cl.EXE"' : return code '0xc0000135'
Stop.

C:\wxWidgets-2.8.12\build\msw>

System info:
- Windows Vista SP2 32-bit Home Premium
- System is REAL; not pirated.
- 2GB RAM
- 2 Ghz dual-core E2180 Intel Pentium CPU
- Maker & model: DELL Insprion 530S
- HDD: 300 GB


Is there something wrong with NMAKE or is it my fault?I think this should've been in Software...The OP is talking about this:
Quote

wxWidgets is a C++ library that lets developers create applications for Windows, OS X, Linux and UNIX on 32-bit and 64-bit architectures as well as several mobile platforms including Windows Mobile, IPHONE SDK and embedded GTK+. It has popular language bindings for Python, Perl, Ruby and many other languages. Unlike other cross-platform toolkits, wxWidgets gives its applications a truly native look and feel because it USES the platform's native API rather than emulating the GUI. It's also extensive, free, open-source and mature. Why not give it a try...
http://www.wxwidgets.org/
Mature?
The wxWidgets is a work in progress.this may help.

1209.

Solve : Easiest programming language?

Answer»

Quote from: ericb82 on March 11, 2011, 06:17:46 AM

If you are talking about a program you could learn easily including the syntax and how it works, you could try C or C++. Some languages like python, would be easy to pick up but this is for advance programmers who already know how to formulate logic.

None of that makes sense. C and C++ have the most complicated syntax and grammar of most programming languages (to the point where C++ is often poked fun at for this very reason). "formulating logic" is something somebody will have to know how to do to even start programming. It's not something only "advanced programmers" would know, and it's no easier to learn how to "formulate logic" with C/C++ then it is with python. Harder, I would guess, given the extra hoops you have to jump through to do anything useful a lot of the time.

Quote
C is good because unlike java, which is an object oriented language, it functions as a whole block.
That also makes no sense. How does C "function as a whole block" and how does it's not having any Object Oriented constructs whatsoever (aside from the PROGRAMMER being able to create their own virtual method tables in a struct) make it advantageous? There is no doubt that often the additional overhead of having to encapsulate objects in classes and objects can be burdensome for programs designed for simple tasks, but to push it's complete absence as an advantage is ridiculous, especially since such an advantage is completely subjective.BC, I would not add or take waway anything you say.
I wish to observe that thenOP has not yet replied. Perhaps he wants a simple quick answer that would require little effort and time.
Here is an internet quote about how there is a collective wishbone for 'learn how to program quickly.'

Quote
Teach Yourself Programming in Ten Years
Peter Norvig

Why is everyone in such a rush?
Walk into any bookstore, and you'll see how to Teach Yourself Java in 7 Days alongside endless VARIATIONS offering to teach Visual Basic, Windows, the Internet, and so on in a few days or hours. I did the following power search at Amazon.com:

pubdate: after 1992 and title: days and
(title: learn or title: teach yourself)

and got back 248 hits. The first 78 were computer books (number 79 was Learn Bengali in 30 days). I replaced "days" with "hours" and got remarkably similar results: 253 more books, with 77 computer books followed by Teach Yourself Grammar and Style in 24 Hours at number 78. Out of the top 200 total, 96% were computer books.
http://norvig.com/21-days.html
I REALLY picked up programming from Windows Batch. After I got tired of making scripts to automate some stuff with my computer, I tried PHP and never looked back. The future is on the web. There's more demand for back-end developers so if web developement is something you're looking to do at a career LEVEL, I would start with HTML/CSS/JS and slowly go to the server side languages with PHP as a starting point and then going on to ASP.NET, Python, etc..how i can learn c++ in easy way Quote from: imransindhu on April 24, 2011, 12:55:39 PM
how i can learn c++ in easy way
See my post #16. It is always easy if you allow ten years.Quote from: imransindhu on April 24, 2011, 12:55:39 PM
how i can learn c++ in easy way

read the tutorial from cplusplus.com thoroughly and practice a minimum of 10,000 hours.Quote from: 2x3i5x on April 27, 2011, 01:20:11 PM
read the tutorial from cplusplus.com thoroughly and practice a minimum of 10,000 hours.
With no disrespect, 2x3i5x,
The OP seems to be bright and attentive.
I wood say he can do well in -
just 9,600 hours of -
constant daily practice on C++.

After all, it is not too hard. C++ isn't difficult, but it has a lot of complicated rules to learn such as Koenig lookup, SFINAE, RAII, exception safety etc. It is also extremely flexible, allowing such things as template meta-programming, and the main confusion is that when you use C, or C++, you are really working in two languages; the language the preprocessor understands and the language the compiler understands. Either way you only pay for what you use, but when there is so much you can use, it takes a lot if you want to learn it all.

But there is never a good reason to "learn it all". Learn only what is applicable to your current need for C++, because if you go gallavanting around learning about template classes when you don't need them, you'll just end up re-learning them when you do.Quote
But there is never a good reason to "learn it all". Learn only what is applicable to your current need...

Good idea even out of context. I'm not much of a programmer but I did program in 8086 assembly and later BASIC and have kept up with DOS through Win98SE .. and then only run XP and Vista without digging DEEP into them. (I mod the registry is about a far as I go) ..

It depends on what you want to do with programming. If it's simply the exercise of learning something in computer language, I really suggest that you go back as far as you can and look over all of the programming 'languages' of which assembly is one and C++ is one of the latest.

Every 'thing' has a programming language including genetics, x-y machine shop machines, your automobile, and nearly any thing you can think of.

So when you ask which is 'easiest' it depends what you plan to do with it.
I do believe that no matter which language you choose you'll be miles and years ahead when you take the time to study the history of all languages.

You can limit yourself to those, languages, that are in line with the one you
focus on and over time branch out to those which had support roles for
the one you focus on. They all had something to contribute.

The reason to look at them all is because no language is perfect. You'll
find that other languages have benefits to them which the one you
use lacks. This won't mean you can combine them but it will mean
that when you see the limitations you'll be better prepared to set
a course when you get down to actually using your chosen language.

Even in English I've learned that it pays, my thinking, to know what
words mean in other languages. Most of English came from French, or
Greek, a bit from Latin. Knowing where from and why an English word
was created makes me that much better at using it.

Check out your aptitude and if it's languages then 'any' languages will
be of interest to your brain. Stop feeding it and your brain will atrophy.
Feed your brain and you can feed everyone else's brain. LovingTheBatchofCookies,
I like your post.
1210.

Solve : Iframe not working in Firefox?

Answer»

Hi guys,
I have a website called the Virtual Company Project, and on one of the pages I have an iframe that is visibility: hidden; until it is called to be shown by a javascript function. Shown below:



Basically, it is an empty iframe, and then a USER clicks on the 'graph' link and it tells the iframe to go to a web address (in this case www.vcp.co.nz/vcp/stockgraph.php?company=whatever) and then makes it VISIBLE centrepage.

However, in firefox, this is not working. If you click graph? it just doesn't appear.

It *does* work in Chrome, Opera, Safari, and Internet Explorer 7/8/9.

The specific code:

What isn't appearing:
Code: [Select]<iframe id="GraphFrame" frameborder="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" allowTransparency="true"
width="90%" scrolling="no" height="420" style="BORDER-RIGHT: none; BORDER-TOP: none; Z-INDEX: 500; LEFT: 20px; BORDER-LEFT: none; BORDER-BOTTOM: none; POSITION: fixed; TOP: 100px; visibility:hidden;">
</iframe>
<div id='CloseGraphFrame' width='20' height='10' style='position: fixed; top: 0px; right: 0px; visibility: hidden; z-index: 501;'>
<a id='boldme' onclick='CloseGraph()'>Close</a></div>
The code that calls it:

Code: [Select]function ShowGraph(company)
{
document.all.GraphFrame.src='http://www.vcp.co.nz/vcp/stockgraph.php?company=' + company;
document.all.GraphFrame.style.visibility="visible";
document.all.CloseGraphFrame.style.top = document.all.GraphFrame.style.top;
document.all.CloseGraphFrame.style.right = document.all.GraphFrame.style.right;
document.all.CloseGraphFrame.style.visibility="visible";
}

Any ideas?
Thank you for asking. I've been pushing to get a word out about web coding
standards and your question might help me do that.

W3C at

w3c.org

has a validator to check the HTML coding to the current HTML standards
and outputs a suggestion to fix the problem if it fails.

Your page has 8 errors and 3 WARNINGS.

see here:

http://validator.w3.org/check?uri=http://www.vcp.co.nz/vcp/stockgraph.php?company=whatever&charset=%28detect+automatically%29&doctype=Inline&group=0

Hopefully fixing the errors and warnings will fix your IFRAME problem.

Could you give it a try? I'll watch this space to see how it works out!

Andre

1211.

Solve : Javascript Loop?

Answer»

Is it possible with a javascript for loop to reference one of the PARAMETERS? Here is my CODE:

for( COUNT = 0; count < 3; count++ ) {
var randomnum = Math.ceil( Math.random() * 8 );

msg += "";

I want to be able to reference each image that is randomly PICKED.

1212.

Solve : Favorite programming software??

Answer»

Quote from: guss on February 07, 2011, 04:34:17 PM

dev-c++ is outdated. Most of the programmers from dev-c++ are working on codeblocks, which is more up-to-date, and better in general, I think.
Who says it is outdated? And what part of it is outdated? Why should it matter? I have tools I got over ten years ago and they still work for simple tasks.
An why single out Dev C++ as being outdated? They all get very dated after two or three years. Banach files are very dated, people still write them.
I was just being informative, no need for hostility. But, if you want to know, the dev-c++ site says:



February 21th 2005 : Dev-C++ 5 Beta 9.2 (4.9.9.2) released !


January 13th 2005 : You can now support Dev-C++ by making a donation !


December 1st 2004 : Dev-C++ 5 Beta 9.1 (4.9.9.1) released !


July 31th 2004 : Dev-C++ 5 Beta 9.0 (4.9.9.0) released !


June 9TH 2004 : Dev-C++ 5 Beta 8.10 (4.9.8.10) released !


May 9th 2004 : Dev-C++ 5 Beta 8.9 (4.9.8.9) released !


February 3rd 2004 : Dev-C++ 5 Beta 8.7 (4.9.8.7) released !


November 23th 2003 : Dev-C++ 5 Beta 8.5 (4.9.8.5) released !


October 20th 2003 : Dev-C++ 5 Beta 8.4 (4.9.8.4) released !
It's not only outdated (last updated early 2005) but it's been deprecated by other free offerings- particularly codeblocks. Most of the developers who worked on Dev/C++, as guss stated, are now working on code::blocks- it's unlikely Dev/C++ will be enhanced in the future. This isn't even counting the issues I noted (such as using a User interface dialog from over 20 years ago).

Quote
Why should it matter?
Because people who use compilers usually want their programs to work with recent configurations. An analogous statement could be to ask "why it matters" wether your windows SDK is for windows 95 or windows 7. Of course considering I'm arguing with somebody who still thinks FORTRAN is the bees knees clearly I'm wasting my breath.
Quote
I have tools I got over ten years ago and they still work for simple tasks.
Compiling the code to a project-organized application is ANYTHING but a simple task. The fact is dev/C++ is free. So is Code::Blocks. code::Blocks is better, more compatible, and is still an active project.
Thank you BC. I do like to be up of up to date almost.
Fortran is old, but not forgotten.
Quote
...
The GNU SCIENTIFIC Library (GSL) is a numerical library for C and C++ programmers. It is free software under the GNU General Public License.
...
Where possible the routines have been based on reliable public-domain Fortran packages such as FFTPACK and QUADPACK, which the developers of GSL have reimplemented in C with modern coding conventions....
http://www.gnu.org/software/gsl/
So they had to have somebody that could still read it.
Quote
So they had to have somebody that could still read it.
Really? that's an interesting assumption, SINCE I ported perl modules to Visual Basic classes years before I knew anything about perl. You are drawing the incorrect implication that because somebody is able to understand code from another programming language they must have had experience using it previously. That is false. You don't need to have been working with FORTRAN for many years to be able to port it to another language.
Good point BC. My First Certified computer code was COBOL. Now I can't write even a line of it.
BTW, it is now Fortran, not FORTRAN.
And if you keep doing that I will call Vista VISTA. Quote from: Geek-9pm on February 07, 2011, 06:27:16 PM
BTW, it is now Fortran, not FORTRAN.
And if you keep doing that I will call Vista VISTA.
I had to rewrite that passage, I recall making it proper-case but I REWROTE it and must have written it in caps.

They are both valid; FORTRAN refers to the versions before FORTRAN-90 (no doubt, then, you are familiar with the "FORTRAN", rather then the Fortran variants) whereas Fortran refers to later versions.

Either way, Fortran is a acronym for FORmula TRANslator, so it's valid anyway; Vista doesn't stand for anything. Quote from: BC_Programmer
Vista doesn't stand for anything.
Let me quote that in future posts. Quote from: jackworgans on April 25, 2011, 12:55:50 PM
I am learning C++ ....It is my favorite programming language.

If it is your favorite, that is enough reason.

For what it is worth, most modem languages allow you to get into the library of some other language if necessary. So you don't have to switch over to another language just because there is some feature you don't readily have in you favorite language.
1213.

Solve : Difficulty with adding?

Answer»

Hi,
I tried writing a simple code that adds two numbers, but things got a little funky... my code is:

Code: [Select]#include <iostream>

int main()
{
int num1;
int num2;
int CALC= num1 + num2;
std::cout << "Please choose two numbers to make your calculation\n";
std::cin >> num1;
std::cout << "Your first number is " << num1 << "!\n";
std::cin >> num2;
std::cout << "Your first number is " << num2 << "!\n";
std::cout << calc;

return 0;
}
When i choose two numbers, it gives me something that just doesnt make sense. For EXAMPLE if I put in 4 and 5 the calc becomes -944204840... any advice?Aren't you trying to make calc equal to 2 values that haven't been entered yet? In the third LINE of main() ? I know modern programming languages are smart but I don't think they include clairvoyance.


So you think i should define the variable after I INPUT the two values?I think you should define calc at the start and input the two values and finally make calc equal to the sum of the two values.
Thanks, that worked LIKE a charm #include <iostream>

int main()
{
int num1;
int num2;
int calc= num1 + num2;
std::cout << "Please choose two numbers to make your calculation\n";
std::cin >> num1;
std::cout << "Your first number is " << num1 << "!\n";
std::cin >> num2;
std::cout << "Your second number is " << num2 << "!\n";
calc = num1 + num2;
std::cout << calc;

return 0;
}



Please ignore above post.


#include <iostream>
int main()
{
int num1;
int num2;
int calc;
std::cout << "Please choose two numbers to make your calculation\n";
std::cin >> num1;
std::cout << "Your first number is " << num1 << "!\n";
std::cin >> num2;
std::cout << "Your second number is " << num2 << "!\n";
calc = num1 + num2;
std::cout << calc;
return 0;
}
one could also use "using namespace std" after the include and refer to cin and cout without the namespace qualifier.

1214.

Solve : how do you get a web page load up automatically in visual basic 2008??

Answer»

I was wondering how to have a WEB browser object auto-load a web page (such as google.com.au)...

does anyone know how to do this in Visual basic 2008 code, not vb6...

i apprieciate this in advance...I know of a dirty way to do it through a system call to Code: [Select]iexplore.exe "www.websiteyourwanttolaunch.com" , but havent done it with VB 2008 yet with PROPER code execution. I have done this correctly in C# but not VB. The C# book I have has an example on creating your own custom web browser, ( BASED around IE ), and you can have it launch in a window web content.Quote from: MusoFreak200 on April 20, 2011, 06:11:32 PM

I was wondering how to have a web browser object auto-load a web page (such as google.com.au)...

does anyone know how to do this in Visual basic 2008 code, not vb6...

i apprieciate this in advance...

HTTP://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx
1215.

Solve : Random Integer in QBASIC??

Answer»

Is it possible to have a random integer in QBASIC, like %random% in BATCH, but it won't TAKE a number over a certain amount, like in Turing?Got it! If I just use a loop and INTEGERS, pretty simple.


a = INT(RND * 10) + 1

is a random number from 1-10.

1216.

Solve : computer programming...(I think)?

Answer»

I recently got a computer. It was sold to my FRIEND from her work... SINCE it is a work computer there is a default backround and SCREENSAVER. I have TRIED to change them but all the areas are greyed out so i cannot select them.. All i want is to have a personalised computer.. What must I do to be able to change it??? please help me.. Thanks a mil.You need to get admin privileges to do that. It sounds like that system is still set up in a 'business account mode.'

I would just try to reinstall windows for security reasons. You have no idea what has happened to that computer while it was in use, and it would be best to give it a fresh install.Quote from: Griff on May 20, 2009, 12:28:21 PM

You need to get admin privileges to do that. It sounds like that system is still set up in a 'business account mode.'

I would just try to reinstall windows for security reasons. You have no idea what has happened to that computer while it was in use, and it would be best to give it a fresh install.
Yeah. A fresh install would allow you to access full admin accounts and other options.
1217.

Solve : Batch File/Script Help needed!!!?

Answer»

Let's see if he COMES BACK and MAKES it CLEAR...

1218.

Solve : Need help with Search and replace VBS?

Answer»

Hi
I'm TRYING to use this script to search and replace strings in src and dat file. The base name is the same for both FILES but extentions are src and dat. I want to be able to select just src file but do sreach and replace on both with out having to run it first on src and the again on dat.
Thanks for your help

heres what i got so far

Dim MyVar

'******opening message
MyVar = MsgBox ("Hello User! 166 Weld renumbering is active! Would you like to proceed?", 3, "Message from EmilWare")
If myvar = 6 Then

Set objDialog = CreateObject("UserAccounts.CommonDialog")

objDialog.Filter = "src/dat files|*.*"
objDialog.InitialDir = "C:\transfer\oldfiles\test4"
intResult = objDialog.ShowOpen
If intResult = 0 Then
Wscript.Quit
End If

sTitle= "Emilware"

nScrW= CreateObject( _
"htmlfile").parentWindow.screen.availWidth
nScrHt= CreateObject( _
"htmlfile").parentWindow.screen.availHeight

showBar oIe, sTitle
WScript.sleep 50

oIe.document.parentWindow.document.scri pt.listop "
"

sInsert = "Program started, please wait...
"
oIe.document.parentWindow.document.scri pt.listop sInsert
WScript.sleep 1000


sInsert = "Flie correction in progress, please wait...
"
oIe.document.parentWindow.document.scri pt.listop sInsert


'******file correction**************
Const ForReading = 1
Const ForWriting = 2

Set objFSO = CreateObject("Scripting.FileSystemObject")


Set objFile = objFSO.OpenTextFile(objDialog.FileName, ForReading)
strOldText = objFile.ReadAll
objFile.Close


strNewText = Replace(strOldText, "PGNO1=0062", "PGNO1=6200", 1, -1 ,1)
strNewText = Replace(strNewText, "PGNO1=0162", "PGNO1=6201", 1, -1, 1)

strNewText = Replace(strNewText, "sw164w0062", "SW164W6200", 1, -1, 1)
strNewText = Replace(strNewText, "Sw164w0062", "SW164W6200", 1, -1, 1)

Set objFile = objFSO.OpenTextFile(objDialog.FileName, ForWriting)
objFile.WriteLine strNewText
objFile.Close

'********* finish message***********
sInsert = "Operation Complete
"
oIe.document.parentWindow.document.scri pt.listop sInsert
WScript.sleep 1000
oIe.quit

MsgBox"Process Complete. Have a GOOD DAY", 0, "Message from EmilWare"

Else

'********* cancel message ***********
MsgBox"Process Canceld !!! No changes made! GOOD BYE.", 0, "Message from EmilWare"

End If

'*************end of APPLICATION **********************************************************************************************************

'**********sub functions
Function showBar (ROIE, usTitle)

Set roIe= CreateObject( _
"internetExplorer.application")

roIe.navigate("about:blank")

Do
WScript.sleep 50
Loop Until roIe.readyState=4

With roIe
.fullScreen= True
.toolbar = False
.statusBar = False
.addressBar = False
.resizable= False
.width= 540
.height= 240
.Left= (nScrW -520) \2
.top= (nScrHt -240) \2

With .document
.writeLn (" ")
.writeLn ("& "border-width:4px"" " _
& "onKeyDown=""vbscript:SuppressKeys"" " _
& "onHelp=""vbscript:SuppressIeFns"" " _
& "onContextMenu=""vbscript:SuppressIeFns"">")
.writeLn ("")
.writeLn ("" & usTitle & "")
.writeLn ("")
.writeLn ("body {background-color:#ece9d8;" _
& "text-align:center;" _
& "vertical-align:middle}")
.writeLn ("")
.writeLn ("")
.writeLn ("function SuppressKeys ()")
.writeLn ("select case window.event.keyCode")
.writeLn ("case 112, 114, 116")
.writeLn ("case else: if NOT " _
& "cbool(window.event.ctrlKey) then " _
& "exit function")
.writeLn ("end select")
.writeLn ("window.event.keyCode= 0")
.writeLn ("window.event.cancelBubble= true")
.writeLn ("window.event.returnValue= false")
.writeLn ("end function")
.writeLn ("function SuppressIeFns ()")
.writeLn ("window.event.cancelBubble= true")
.writeLn ("window.event.returnValue= false")
.writeLn ("end function")
.writeLn ("function ListOp (usInsert)")
.writeln ("window.insertfile.insertAdjacentHtml " _
& """beforeBegin"", usInsert")
.writeln ("window.insertfile.scrollIntoView")
.writeLn ("end function")
.writeLn ("")
.writeLn ("")
.writeLn ("")
.writeLn ("")

& "font-family:Arial;font-size:16pt;" _
& "font-weight:bold"">")
.writeLn ("Executing Program")
.writeLn ("
")
.writeLn ("& "style=""height:150px;width:460px;" _
& "max-height:100%;max-width:100%;" _
& "padding-left:10px;text-align:left;" _
& "font-family:Arial;font-size:10pt;" _
& "font-weight:bold;border-style:inset;" _
& "border-width:thin;overflow:scroll"">")
.writeLn ("")
.writeLn ("")
.writeLn ("
& "width:400px;font-family:Arial;" _
& "font-size:10pt;" _
& "font-weight:bold"">")
.writeLn ("
")
.writeLn ("")
.writeLn ("")
End With


.visible= True
End With

WScript.sleep 100
CreateObject("wscript.shell").appActivate _
usTitle

please helpQuote from: emilware on May 19, 2009, 06:54:25 PM
please help
Please don't double post, this thread is still pretty high up and someone who knows VBS more than me will help you.judging from your script above, isn't something like this should be simple:

Code: [Select]f=objdialog.filename
datfilename=fso.getparentfoldername(f) & "\" & fso.getbasename(f) & ".dat"
wsh.echo datfilename
use fso to open src and dat file and then replace on each file. your script already contain sample on opening file, replacing text and rewrite the file with new text.
1219.

Solve : Icon associated dll?

Answer»

i mean I want to create an icon associated dll file. Clearly SPEAKING I want to put the icon file into the dll file.put it in a resource in the dll.Quote from: BC_Programmer on May 18, 2009, 01:22:03 PM

put it in a resource in the dll.
Which you will need RESHacker for right?not necessarily; Visual STUDIO 6 can open executables/DLLs and edit their resources (I think) and of course if they are the creator of the DLL they can simply change the resources themselves.

Eitherway, resource hacker is a far better alternative to trying to get Visual Studio to cooperate, exporting the dll's RES file, decompiling the RES file, extracting the resources to change, changing them, recompiling the RC file,etc...

reshacker is far easier.Quote from: BC_Programmer on May 19, 2009, 07:52:56 PM
not necessarily; Visual Studio 6 can open executables/DLLs and edit their resources (I think) and of course if they are the creator of the DLL they can simply change the resources themselves.

Eitherway, resource hacker is a far better alternative to trying to get Visual Studio to cooperate, exporting the dll's RES file, decompiling the RES file, extracting the resources to change, changing them, recompiling the RC file,etc...

reshacker is far easier.
I used res hacker to modify my start menu button text...then I changed it back... I think I used it a while back to ENHANCE the VB6 associated icons for classes, modules, forms and so forth to use the equivalent .NET icons that looked the same.

I also used it to remove the ads from MSN messenger.Quote from: BC_Programmer on May 19, 2009, 08:03:05 PM
I think I used it a while back to enhance the VB6 associated icons for classes, modules, forms and so forth to use the equivalent .NET icons that looked the same.

I also used it to remove the ads from MSN messenger.
Lol nice...And of course- inserting Common control manifest in programs that refuse to use the Luna look... such as VB6. I did lose the use of the colour palette in the properties window but that was fairly inconsequential.
1220.

Solve : QBASIC Download Link??

Answer»

As the title suggests, I am looking for a link to download QBASIC 1.1 (which I was told is the easiest VERSION to learn). I don't want anyone telling me how much Such-and-such language is better than QBASIC, I just want QBASIC. Thank you in advance.http://www.qbcafe.net/cgi-bin/downloads/download.pl?dlid=caT8KNMrODZPM&compiler/interpreter=qb11.zip


there you are. just a quick little google and you could have had it yourself!


Also, I might add that QBASIC is INCLUDED on DOS and windows install media from windows 95 to windows ME (not sure of 2000, but I know it's not on the XP CD).


Also you might get best results running QBASIC under DOSBOX or under a virtual machine; it doesn't really like XP much.Quote from: BC_Programmer on May 19, 2009, 07:57:52 PM

http://www.qbcafe.net/cgi-bin/downloads/download.pl?dlid=caT8KNMrODZPM&compiler/interpreter=qb11.zip


there you are. just a quick little google and you could have had it yourself!


Also, I might add that QBASIC is included on DOS and windows install media from windows 95 to windows ME (not sure of 2000, but I know it's not on the XP CD).


Also you might get best results running QBASIC under DOSBOX or under a virtual machine; it doesn't really like XP much.
Request Denied. This file is only AVAILABLE at Quick Basic Cafe. *Redirects to Quick Basic Cafe*http://www.qbcafe.net/qbc/english/download/compiler/qbasic_interpreter.shtml

try DOWNLOADING from there instead. (same file, but it's at that site... they must be checking the referrer)Quote from: BC_Programmer on May 19, 2009, 08:01:44 PM
http://www.qbcafe.net/qbc/english/download/compiler/qbasic_interpreter.shtml

try Downloading from there instead. (same file, but it's at that site... they must be checking the referrer)
Just did (beat you to it lol).
1221.

Solve : Regular Expressions - VBscript?

Answer»

I have a config file that passes Parameters to a VBscript, in this VBscript I want to confirm that the Parameter is correct.

Parameter could look something LIKE this. P 2%r XXX without the spaces

P is a value that can be any letter a-z upper or lowercase

2%r should always stay the same

and XXX can be any letter a-z upper or lowercase and any number.


RegExp
[a-zA-Z][%][2][r][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9]

[a-zA-Z] - This part seems to be BROKEN in that if the user miskeys the config Ppp or PP will still be acceptable and I only need a Single letter to be acceptable

I think [%][2][r] is ok, but tweak if you KNOW a better way.

I am thinking I have the same problem with this piece [a-zA-Z0-9] as {3} grouping doesn't seem to be working. I am not testing in VBscript and maybe that is my issue. I am testing in UltraEdit which ALLOWS you to use regular expressions for searching.

Any and all help is appreciated. Thanks. Code: [Select]Dim regEx
strWords = "P2%rXXX"
Set regEx = New RegExp
regEx.Pattern = "^[a-z]2%r[a-z0-9]{3}$"
regEx.IgnoreCase = True
Set colMatches = regEx.Execute(strWords)
WScript.Echo vbNewLine & "Resulting Matches:"
For Each objMatch In colMatches
WScript.Echo "At position " & objMatch.FirstIndex & " matched " & objMatch.Value
Next
Thanks that seems to work.

Being REALLY new to the whole VBS world would you be able to elaborate as far as far as using the Boolean (True, False) to return to the primary Function 0 it matches 1 it failed exit.

Thanks again for any and all help.Woot! looks like I got it to work. Thanks for the assistance

strWords = GetFileMask
Set regEx = New RegExp
regEx.Pattern = "^[a-z]%2r[a-z0-9]{3}$"
regEx.IgnoreCase = True
ExpressionMatch = regEx.TEST(strWords)


If ExpressionMatch Then
'''WScript.echo regEx.Pattern & " was found in " & strWords
CheckMflag = 0
Else
'''WScript.echo regEx.Pattern & " was not found in " & strWords
CheckMflag = 1
End If

1222.

Solve : Put icon into the .dll file?

Answer»

I WANT to write a .dll file. I want to put an icon file into that dll file. Please help me to write
a VC++ CODE to include the icon file into the dll file.
THANKS
devduttaaPlease don't double POST.

1223.

Solve : creating a .dll file that associates icon?

Answer»

I have an icon file ,say abc.ico. I want to create a .DLL file which associates this ico file.
This is like shell32.dll. I want the code in VC++. Please help me. You are witting a DLL FILES in VISUAL C++ and you want to associate it with and icon file? Is that what your read in the documentation?
When you create the DLL you have the option of allowing an icon to be PUT into the DLL. Is that what you mean?

1224.

Solve : Qbasic key repeat?

Answer»

Im making a game in qb where the arrow keys control a sprite on screen. I currently use: k$ = INKEY$. Then check k$ to change to x/y coordinates of the sprite by +/- 10.
The problem is that when any direction is held down the sprite will move very quickly in that direction. I want it so that when an arrow key is pressed, the sprite will move once, then the key must be released for it to move againn in that direction.you'll need to create a "flag" variable, such as "LASTKEY", you would set this variable to the value of K$ at the end of the game loop (or equivalent). When your comparing the values of K$ to determine which direction to move, you make sure that the current value of LASTKEY is "", which would mean that this is the FIRST time the key was held down.Ive tried but i still cant get it to work.
Heres how the main loop of the game is structured:
Code: [Select]DO
...
...
...
k$ = INKEY$

IF k$ = CHR$(27) THEN END
IF k$ = CHR$(0) + CHR$(72) THEN y = y - 10
IF k$ = CHR$(0) + CHR$(80) THEN y = y + 10
IF k$ = CHR$(0) + CHR$(75) THEN x = x - 10
IF k$ = CHR$(0) + CHR$(77) THEN x = x + 10
...
...
...
LOOP
Can anyone show me how exactly to get it to work with this code.basically, you only want to handle a keystroke if the previously detected key was "" (or no key)
That is- as long as they push a key, it will not continue with the symptoms you describe.


try this- LASTKEY$ holds the key from the previous iteration.
Code: [Select]DO
...
...
...
k$ = INKEY$
IF LASTKEY$="" THEN
IF k$ = CHR$(27) THEN END
IF k$ = CHR$(0) + CHR$(72) THEN y = y - 10
IF k$ = CHR$(0) + CHR$(80) THEN y = y + 10
IF k$ = CHR$(0) + CHR$(75) THEN x = x - 10
IF k$ = CHR$(0) + CHR$(77) THEN x = x + 10
END IF

LASTKEY$=K$
...
...
...
LOOP


I'm a little rusty with QuickBasic, but I'm pretty sure INKEY$ returns an empty string when no key is pressed.
Thankyou I was correct in understanding the first time after all but it doesn't work.
Any clue as to why?
And according to the help file: INKEY$ returns a null string if there is no character to return.null string and "" are the same thing. Looks like I'm gonna have to fire up my old laptop and figure this out.I tried to get it to work, but for some reason, it doesn't work. Maybe a Null String is different then an empty one in QB.


One possible solution would be to use "ON KEY" events.Thanks for trying anyway. ill just have to keep trying and maybe i could use 'on key'Oh wait a second- is this QBASIC, or QuickBasic?I am using qbasic 1.1 now but i may also have quickbasic 4.5 to use if it helpsI don't know about QBASIC having ON KEY, I haven't used that in a VERY long time- QuickBasic 4.5 likely has it, however.

Generally, you have ON KEY (keycode) GOTO (label)

and then you have the code for that keycode- I believe the exact syntax is presented in the online help.

On the other hand, Now that I think about it- there is no way to perform the flag testing I mentioned beforehand, so I'm not sure how that would work...


I just did, however, recently recall what a "null string" means in QB- Instead of comparing to an empty string "" as I did, I believe one would have to use VarPtr or StrPtr or a SIMILIAR function, to determine that it's pointer isn't 0.


I apologize for my vagueness, I haven't done QB very much in over 3 or 4 years. If I get time I might check this out myself, but I'm almost positive there will be some use of a Pointer-type function.I still havent got sorted yet...
From what i can find out searching the internet a null string in qbasic/quickbasic is the same as an empty string or ""
Ive investigated VarPtr and it seems that it returns the memory offset of a variable which remains the same regardless of the value of the variable. ie i cannot use it to check when the string is null as it will not change.
I dont know of any pointer functions and could not find ANYTHING else in the help index. I also think ON KEY events will not help because it does not solve the problem only provides another way of retrieving the input..This seems like such a simple problem. We must be overlooking something obvious here.

Your definitely right about the ON KEY only providing a different method of input-


In the interim, what you could do is programmatically change the typematic rate for the duration of your program- it won't stop the repeat, but you can greatly reduce it.I used the method of solving this problem as stated at the beginning of the thread, and it worked just fine for me. my program does not work, however, this is due to graphics issues.wow i was suprised to see this resurrected.
I gave up with qbasic a long time ago but i'm still interested...

Could you show me at least part of your code if it works for you.
Also which program version are you running and on what system?

I'm also happy to help with your graphics issues if you need it.

1225.

Solve : File size separating?

Answer»

I have some txt files and i want them all to be separated in text files less than 10 kb (9.9 kb or something like that). I'd like a batch FILE but it could be USEFUL even if it is in c++ or c#. I want the program to create NEW files with similar names like:

myfile : 15 kb

after program executing

myfile1 : 10 kb
myfile2 : 5 kb

If you need this: i want to put the program in the same directory as the txt files.you can go here . download it and play with the split command.Just something you may want to check out:

HJSplit: http://www.freebyte.com/hjsplit/Thanks both. I used the carbon's splitter because gh0st's link had too much stuff to read.LOL take the easy way out.

Anyways, GLAD to help.

1226.

Solve : QBASIC Programming for Kids?

Answer»

Some of use do not like the .NET method because it requires so much additional changes to be made to the system. The older BASIC compilers had a single RUN TIME library that did not have to be pushed into the system.

For the QB 4.5 compiler for QBASIC and Visual Basic for DOS, look here:

http://www.qbcafe.net/qbc/english/download/compiler/qbasic_compiler.shtmlQuote from: Geek-9pm on May 14, 2009, 10:43:46 AM

The magic of QBASIC is that you did not have to declare anything, except in real TOUGH applications. Just $ to identify a string and everything else was a floating point number. Great for Kids and ANYBODY starting out. Even simple arrays were automatic.
many other modern programming languages, eg Python have better data structures such as dictionaries and far much better than QBasic in terms of libraries / modules, string parsing engines, etc... and definitely suited for kids as well...Quote from: Geek-9pm on May 14, 2009, 05:37:03 PM
Some of use do not like the .NET method because it requires so much additional changes to be made to the system. The older BASIC compilers had a single run time library that did not have to be pushed into the system.

For the QB 4.5 compiler for QBASIC and Visual Basic for DOS, look here:

http://www.qbcafe.net/qbc/english/download/compiler/qbasic_compiler.shtml

True and you have to install the NET framework on the COMPUTER to run .NET apps.

To bad they can't let you just build it into a stand-alone(no framework) EXE.
1227.

Solve : C++ Header File?

Answer»

Im teaching myself how to program with c++ so im not so good at it, Im trying to get my header file to work, and the compiler comes up with an error saying
" multiple definition of `Var' "

So I think that I have a typo in the header somewhere, I looked multiple times and I didnt see anything, the #ifndef statements are correct, I included the header in 3 files and they are all written correctly

Here is the statements that I have, I left the bulk of the code out so i didnt take to much room but if you need it i can post it up.
Maybe you guys can find something i didnt.


#ifndef Header_H
#define Header_h
//Code
#endif


#include "Header.h"
//code


Thanks for your helpHave you defined 'Var' anywhere in your source? If yes, check if thats twice...
.
Just an advice- Use the once pragma insteada the inclusion guard you are using.I checked that also and i didnt see any, but to make sure it had to do with my header I put another varaible in the header that I know isnt used elsewhere in the program and the same error came up, but it also included the variable that I put in the header. and the error comes up the same number of times Ive included the header file in any other file. The error message repeats 3 times. Please post the complete[/u] code.Its a game of Battle Ship, not finished yet but it still doesnt work

/*****
Header
*****/
#ifndef BattleHeader_H
#define BattleHeader_h


int DisplayBoard(bool Board[][5]);//display function
int PlaceShips();//PlayerPlaces Ships


bool PlayerShips[5][5];//false is water, true is ship
bool PlayerStrikes[5][5];//false is 'havent hit' true is 'hit'

#endif

/*****
Main
*****/
#include
#include "BattleHeader.h"

using name espace std;

int main()
{
cout <<"Welcome to Battle Ship\n";
cout <<"The '1's on your display board are ships and '0's represent water.\n";
cout <<"The '1's on your Target Board are places you already fired at.\n";

//Main loop



for(int i=0; i < 5; ++i)
{
for(int j=0; j <5; ++j)
{
PlayerShips[ i][j] = false;
}
}

for(int i=0; i < 5; ++i)
{
for(int j=0; j <5; ++j)
{
PlayerStrikes[ i][j] = false;
}
}
PlaceShips();//Place Ships


//Secondary Loop

int MenuChoice;
cout <<"Main Menu\n";
cout <<"____________\n";
cout <<"[1]-Display My Ships\n";
cout <<"[2]-Display Where I Already Fire\n";
cout <<"[3]-Fire At The Enemy\n";

cout <<"[";
cin >> MenuChoice;
cout <<"]\n";

if (MenuChoice == 1)
{
DisplayBoard(PlayerShips);
}

if (MenuChoice == 2)
{
DisplayBoard(PlayerStrikes);
}

return 0;
}


/*****
Place Ships
*****/
#include "BattleHeader.h"
#include


using namespace std;

int PlaceShips()
{




cout <<"Enter the cordinates of the starting point of your ship starting at Row: '1' --- Column: '1' \n";
cout <<"You get 3 ships to place that are 3 spaces long\n";

int Column = 0;//Players Vars that tells where they want their ship to start
int Row = 0;

int ShipsPlaced = 0;//Counts ships placed


do{ // Main loop of function that iterates 3 times
ShipsPlaced += 1;


int loop;//used to loop back if their ship ends up off of the board
do{
DisplayBoard(PlayerShips);//Display the board for them

loop = 2;//declares it 2 so it doesnt loop back if not needed

cout <<"Enter the Row Number: ";
cin >> Row;
cout <<"Enter the Column Number: ";
cin >> Column;

Row -= 1;//So the player doesnt have to compensate for the natural ARRAY starting position
Column -= 1;


cout <<"Do you want your ship to go...\n";
cout <<"[1]Up\n";
cout <<"[2]Down\n";
cout <<"[3]Left\n";
cout <<"[4]Right\n";

int ShipDirection;
cin >> ShipDirection;



for (int i = 0; i < 3; ++ i)// places the first cordinate then tests which way they wanted their ship to go and iterates through the loop 3 times
{
PlayerShips[Row][Column] = true;

if (ShipDirection == 4)
{
Column += 1;
}

if (ShipDirection == 3)
{
Column -= 1;
}

if (ShipDirection == 2)
{
Row += 1;
}

if (ShipDirection == 1)
{
Row -= 1;
}

}


//if ship ends up off board then it loops back to TOP
if (Column > 5 || Column < 0 || Row > 5 || Row < 0)
{
cout <<"The Direction you choose puts the ship off the board\n";
cout <<"please choose again\n ";
loop = 1;
}

}while(loop == 1);

}while (ShipsPlaced < 3);

return 0;
}

/*****
Display
*****/

#include
#include "BattleHeader.h"

using namespace std;

int DisplayBoard(bool Board[][5])
{


for (int R = 0; R < 5; ++R)
{
for (int C = 0; C < 5; ++C)
{
cout << Board[R][C] << " ";
}
cout < }

return 0;

}




Since its not finished I put comments in place of some functoins and loops, but it should still be working


This is the errors I get with this code
multiple definition of `PlayerShips'
first defined here
multiple definition of `PlayerStrikes'
first defined here
multiple definition of `PlayerShips'
first defined here
multiple definition of `PlayerStrikes'
first defined here
ld returned 1 exit status
C:\Documents and Settings\home\My Documents\C++ ProgramFiles\MultipleSource Files\BattleShip\Makefile.win [Build Error] [BattleShip.exe] Error 1 Sorry, cant do much right now, on a mobile phone.
Using Dev-C++?Code: [Select]#ifndef Header_H
#define Header_h
//Code
#endif


#include "Header.h"
//code


why does the ifndef check for header_H (capital H) whereas you define "Header_h" within the block?

This is likely the issue since it will be including the same file multiple times.Yes, did you not try the

Code: [Select]#pragma once

as Ralph said?I tried changing the capital H to a lower ONE, and the lower h to a capital one and same error came up.


QUOTE from: Ashutosh32 on May 02, 2009, 12:22:44 AM

Yes, did you not try the

Code: [Select]#pragma once

as Ralph said?

Sorry, Im new to c++ so i haven't learned about #pragma yet
if you could explain how to use it in my case to help me Ill be greatly thankful


Quote from: Ashutosh32 on May 01, 2009, 02:32:52 PM
Sorry, cant do much right now, on a mobile phone.
Using Dev-C++?
and yes I am using Dev C++Remove the #ifndef mess, just add the line

Code: [Select]#pragma once

in the top of your source file. Quote from: Ashutosh32 on May 02, 2009, 11:22:06 PM
Remove the #ifndef mess, just add the line

Code: [Select]#pragma once

in the top of your source file.
thanks for the information but I ENDED up getting the same errorSo is there an error in my code or is it my compilerIf it's any help, I got the same errors trying to compile with Visual C++ 6.
1228.

Solve : How can I display specific data??

Answer»

Dear Sir

I have designed a database program. There is a form named as "Purchase DATA Entry". I can insert & save data. Now, I want to display the sum of data (in a text BOX on the same form) along with the previous, for example, previously Computer was 10, now it is 20 after addition. But while doing so, it does display only the first or last or next data.
I have designed a query file from the table which sum the ENTIRE Item, say total Computer or total Monitor etc.
Now, if I use the below code, it displays either first or next or last data but not the latest data which has been added/saved in the table.

The code which I have used is as follows:
Dim rst1 As New ADODB.Recordset
DBconnect
If rst1.State = adStateOpen Then rst1.Close
rst1.Open "qrytotalpurchase", cnt, adOpenDynamic, adLockOptimistic
If Not rst1.EOF() Then rst1.MoveNext
Text1.Text = rst1.Fields(0)

I have fallen in trouble. Please help.
If I can't understand my problem, please let me KNOW.

So FAR I know, there is a option which search whole data by the symbol <> and fetch the specific.

Appreciate, if you would come back soon.


Regards
talorababu

1229.

Solve : Programming help?

Answer»

im having trouble understanding this programing class i have and how to complete it so if you COULD PLEASE help it would be greatly appreciated. im not sure how to create the constructor and complete the data in exercise 1, and in exercise 2 i dont understand what to complete and how to complete it.
"
Exercise 1 ― Constructor and Print
Complete the constructor in the following program so that it constructs the array data, then copies values from the parameter array into data.

Then complete the print() method. If you want, write it so that it prints seven values per line, except for the last line.

import java.io.* ;

class Weight
{
int[] data;

// Constructor
Weight(int[] init)
{
// Construct the array the same length
// as that referenced by init.
data = new ....

// Copy values from the
// INPUT data to data.
for (int J.....)
{
data[j] =
}
}

//Print
void print()
{
for (int j.....)
{
System.out.println();
}
}

public static void main ( String[] args )
{
int[] values = { 98, 99, 98, 99, 100, 101, 102, 100, 104, 105,
105, 106, 105, 103, 104, 103, 105, 106, 107, 106,
105, 105, 104, 104, 103, 102, 102, 101, 100, 102};
Weight june = new Weight( values );
june.print();
}
}
"
"
Exercise 2 ― Average
Now add an average() method to the class. Use integer math.

import java.io.* ;

class Weight
{
. . .

int average()
{
. . .
}

public static void main ( String[] args )
{
int[] values = { 98, 99, 98, 99, 100, 101, 102, 100, 104, 105,
105, 106, 105, 103, 104, 103, 105, 106, 107, 106,
105, 105, 104, 104, 103, 102, 102, 101, 100, 102};
Weight june = new Weight( values );
int avg = june.average();
System.out.println("average = " + avg );
}
}

To check your method, initialize the array to ten values that have an easily COMPUTED average


1230.

Solve : Programming question?

Answer»

I have a question for the programmers....Can someone advise me as to the the best MS software which would help me LEARN to program....I have free access to all titles for another week or so and I saw Patios' reference to Windows 7, so I'm downloading that as I type, but I see alot of titles I know would be useful but I'm just not sure what I need. Any suggestions for basic programming?It depends on your objectives.
Making modifications or extensions to the Microsoft Windows Stem requires knowledge of C and C++ programming.
To create and deploy large, comprehensive partial applications that people will use in their daily work requires knowledge of all the Visual Basic tools made by Microsoft.
Visual Basic 6 is still the main focus in many commercial applications.

Your ability to read documentation and catch subtle details is very important.
Thank you Geek-9pm

I will download Visual Basic 6.

Are C and C++ part of VB6 or are they standalone programs?

You can download the entire Visual Studio.
Each part can be used as a stand alone package.
They do share the same libraries. They require the dot NET system.Thanks for that.......Quote from: KARNAC on May 03, 2009, 10:18:14 AM

Any suggestions for basic programming?
if you want to learn programming, you can try Python. It easy to learn, can not only be used on Linux, but also Mac, and of course windows. Quote from: gh0std0g74 on May 03, 2009, 07:21:31 PM
if you want to learn programming, you can try Python. It easy to learn, can not only be used on Linux, but also Mac, and of course windows.

Thank you....Quote from: Geek-9pm on May 03, 2009, 11:08:21 AM
You can download the entire Visual Studio.
Each part can be used as a stand alone package.
They do share the same libraries. They require the dot NET system.

Is it free now? Did I miss that?
No Dias, the technical college I'm attending has an agreement with M$ that allows us to download most any M$ product free of charge.....full complete programs.........and we are instructed to make use of the service as much as possibe, so I've basically more than covered the tuition costs with the free programs I have downloaded.
Only program I would have to pay for would be Office 2007, which they sell for $65.Quote from: Karnac
the technical college I'm attending has an agreement with M$

Ah, I understand. But outside of such agreements, people can't just "download the entire Visual Studio" legally, I THINK. At least not without paying M$ some serious money.

Quote from: Karnac on May 04, 2009, 08:31:06 AM
Only program I would have to pay for would be Office 2007, which they sell for $65.
why waste your $$ when you can have it free.? Open Office is definitely a good alternative if you don't want to spend the money for Microsoft Office.Quote from: Dias de verano on May 04, 2009, 06:52:40 AM
Is it free now? Did I miss that?
Yes and No.
http://www.microsoft.com/Express/
You can use the 'express' version as atrial.
For useful commercial work you would pay some serious money.I am transferring files from windows to unix, with this i want to include inside my batch file , to LOG error if any or if successful, then write at a certain file. PLEASE advise.My advice is to start a new topic.
1231.

Solve : Call pdf file from visual basic 6.0?

Answer»

Help me!

I like call always other PDF file from visual basic program
What wrong this lines?
Thank you

Private Sub Command1_Click()

Dim iResult As Double
Dim iPath As String
Dim filename
filename = "d:\2009calendar.pdf"
iPath = "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe filename "
iResult = Shell(iPath, vbMaximizedFocus)

End SubQuote

iPath = "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe filename "


Change the line to

Code: [Select]iPath = "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe" & " " & filename
You can't use Variables inside double quotes. Only String values are represented by double quotes. your inserting the filename within the string:

Code: [Select]Private Sub Command1_Click()

Dim iResult As Double
Dim iPath As String
Dim filename
filename = "d:\2009calendar.pdf"

'iPath = "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe filename "
'Fixed line below:
iPath = "C:\Program FIles\Adobe\Acrobat 7.0\Reader\AcroRd32.exe " & filename
iResult = Shell(iPath, vbMaximizedFocus)

End Sub


That should work.

However, while I'm here- how about I GIVE you some suggestions for improvement? As an example, instead of EXECUTING Acrobat reader directly, it's possible to instead execute the pdf file itself, which opens the program that is set to open PDF files.


To do this, Place this code in the Declarations section of the form (the very top, underneath "Option Explicit" if present.

Code: [Select]Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long

And then place this at the bottom of the rest of your code...
Code: [Select]Private Function ShowFileDefault(FilePath As String, ownerHwnd As Long) As Boolean
Dim dummy As Long

'open the file using the default Editor or viewer.
dummy = ShellExecute(ownerHwnd, "Open", FilePath & Chr$(0), Chr$(0), _
Left$(FilePath, InStr(FilePath, "\")), 0)


ShowFileDefault=Dummy



End Function


As for your original code, to use the new routine:

Code: [Select]Private Sub Command1_Click()

Dim iResult As Double
Dim iPath As String
Dim filename
filename = "d:\2009calendar.pdf"

'replaced this block...
'iPath = "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe filename "
'Fixed line below:
'iPath = "C:\Program FIles\Adobe\Acrobat 7.0\Reader\AcroRd32.exe " & filename

'iResult = Shell(iPath, vbMaximizedFocus)



'with this line:
ShowFileDefault Filename, Me.Hwnd


End Sub


I hope this helps! Thx all!while using the last code in my project and run i got the message

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long

-- i added this option in the general declarations option


Private Sub mnuHelpGeneral_Click()
Dim iResult As Double
Dim iPath As String
Dim filename

filename = App.Path & "\help.pdf"
ShowFileDefault filename, Me.hWnd
End Sub


-- i Added this in the in the help click option

Private Function ShowFileDefault(FilePath As String, ownerHwnd As Long) As Boolean
Dim dummy As Long

'open the file using the default Editor or viewer.
dummy = ShellExecute(ownerHwnd, "Open", FilePath & Chr$(0), Chr$(0), _
Left$(FilePath, InStr(FilePath, "\")), 0)


ShowFileDefault = dummy



End Function


-- i added this in the bottom of the code

but while i run the source and got error messages


ByRef argument type mismatch


please help me to solve this problemCode: [Select]Dim filename

dimensions a Variant type variable. ShowFileDefault wants a String. Either change the Dim to say:

Code: [Select]Dim filename as String


Or, optionally, change the showFiledefault declaration to:
Code: [Select]Private Function ShowFileDefault(Byval FilePath As String, ownerHwnd As Long) As Boolean


which will attempt to convert the given argument (in this case, a variant) to the required string.
Code: [Select] dummy = ShellExecute(ownerHwnd, "Open", FilePath & Chr$(0), Chr$(0), _
Left$(FilePath, InStr(FilePath, "\")), 0)
and if the 5th argument (lpDirectory) means WORKING directory, then InStrRev should be used instead of InStr that returns the root drive??Or, just leave it blank. That works too.

Probably change the 0 to vbnormalFocus as well; 0 appears to make it appear on the taskbar but not be able to display the window to the program.

I prefer ShellExecuteEx myself, actually.yup, correct, that works too.
from msdn reference:
http://msdn.microsoft.com/en-us/library/bb762153(VS.85).aspx
Quote
lpDirectory
[in] A pointer to a null-terminated string that specifies the default (working) directory for the action. If this value is NULL, the current working directory is used. If a relative path is provided at lpFile, do not use a relative path for lpDirectory.
nShowCmd
[in] The flags that specify how an application is to be displayed when it is opened. If lpFile specifies a document file, the flag is simply passed to the associated application. It is up to the application to decide how to handle it.
SW_HIDE
SW_SHOWNORMAL

ShellExecuteEx API looks complicated, but seems to provides more control on the created process. do you have a wrapper module for ShellExecuteEx?It's not really that complicated...

Here's one that uses it to show the Open With dialog for any file:

declarations:
Code: [Select]Private Declare Function GetCurrentProcess Lib "kernel32.dll" () As Long

Private Declare Function ShellExecuteEx Lib "shell32.dll" (ByRef lpExecInfo As SHELLEXECUTEINFOA) As Long
Private Type SHELLEXECUTEINFOA
cbSize As Long
fMask As Long
hwnd As Long
lpVerb As String
lpFile As String
lpParameters As String
lpDirectory As String
nShow As Long
hInstApp As Long
' fields
lpIDList As Long
lpClass As String
hkeyClass As Long
dwHotKey As Long
hIcon As Long
hProcess As Long
End Type


Code:
Code: [Select]Public Function OpenWith(ByVal HwndOwner As String, ByVal FilePath As String, Optional ByVal Icon As Long = 0) As Long

Dim sei As SHELLEXECUTEINFOA
Dim verba As String
verba = "openas"
sei.hIcon = Icon
sei.hProcess = GetCurrentProcess()
sei.hInstApp = App.hInstance

sei.lpVerb = verba
sei.lpFile = FilePath
sei.nShow = vbNormalFocus
sei.cbSize = Len(sei)

OpenWith = ShellExecuteEx(sei)


'Stop

End Function

'another option, would be to allow for the verb to be specified as an argument, along with several other PORTIONS of the structure.
1232.

Solve : i have a dell laptop and am inthe command prompt to format windows vista hard dv?

Answer»

I need to know what to type the available options are

my purpose is to start over with clean hard drive I have the oem
but i dont know how to prepare the GARD drive
im running vista ultimate

and break call cd chcp chdir cls copy ctty date
del dir echo erase exit for gosub goto idle if
lh loadhigh md mkdir or PATH pause prompt rd
rem ren rename return rmdir set shify switch time truename
type ve verify voli usually do the following for WINDOWS XP,2k,me,98:
1. backup all documents/files to removable drive
2. boot with bootable-cd and run DOS command prompt
3. run fdisk, and partition to suitable size
4. format the CREATED partition
5. run smartdrv.exe
6. install new OS

alternative:
i think it's possible to skip step 2-5 with booting with OS-CD and let the install-wizard do the rest, but i never try that.
or some LAPTOP comes with a hidden partition (what do you call it?) that can restore laptop to the factory condition.

1233.

Solve : ADD ONS?

Answer»

can any ONE TELL me what they are and what to look for and delete the one s that are a PAIN, thank youIn what context?DEFINE "pain."

1234.

Solve : Preventing task manager appearing over a program in VB.Net?

Answer»

I have created a full screen PROGRAM in VB.Net that requires a password to exit, however I can still end it using the processes tab in task manager.

Is there any way that I can prevent task manager being shown (or even sent behind the main form) while the program is running.

The program is full screen.I think this --> http://en.allexperts.com/q/VB-NET-3306/Preventing-user-showing-Task.htm <-- should help.

Good luck.This is the sort of SITUATION where privileges need sorting out. If the logged in user is allowed to USE Task Manager, why do you want to stop them?

1235.

Solve : Correcting a program?

Answer»

Can somebody help me fix this program? Thanks!
Code: [Select]#include <conio.h>
#include <iostream.h>
int main()
{
cout << " *:+++++*##.+#@########***###@ " << endl;
cout << " +:++++++##W*#+W########@#***#@#### " << endl;
cout << " *:.++***###[emailprotected]##[emailprotected]#######@#**###*#@ " << endl;
cout << " .#:.:+*****#[emailprotected]@##**#####*#@ " << endl;
cout << " .,##:::*******######@#####*# " << endl;
cout << " ,..+##:+:*******#############**####@#####**#@ " << endl;
cout << " :...+:@#*:++*****############****#######@###**# " << endl;
cout << " .....:::@#+++****############****######**## " << endl;
cout << " :.....:::[emailprotected]@##*+++***##########*********# " << endl;
cout << " :......::+*::::####+::++*******## " << endl;
cout << " :.:...::*::::******@###@*:: " << endl;
cout << " :....:::.::**:::::***::::::*+:::*:*:+ " << endl;
cout << " :..:::::,,*::::::::::*::::*::::::**++ " << endl;
cout << " ::...:+:,,,,,:::::::::::::::::::::*++ " << endl;
cout << " :...:::,,,,,,WWWWWW:::::::::WWWWW:#+* " << endl;
cout << " ***:+::,,,,WWWWW+WWW:::::::WWW*WWW#** " << endl;
cout << " *.,:+:+,,,W+:W#W W+W,,,::::[emailprotected]:W*W#** " << endl;
cout << " *,,,+:+,,,W+ W#W#W:W,,,,,,,W#[emailprotected]+W+:* " << endl;
cout << " *,:+,,+,,,*: W*W#W *,,,,,,,:*W#W*W+:* " << endl;
cout << " +,,.+,+,,,,*WW***W ,,,,,,,, ***WW+++* " << endl;
cout << " +,,,.,,,,,,,,*WWW#*,,,,,,,,*WWW,.+:* " << endl;
cout << " *.,,.:,,,,,,,,,,,,,,,,,,,,,,,,,,+** " << endl;
for(int w=1;w<=22000;w++)
{
gotoxy(1,1);
cout << " *.:++++**#@#[emailprotected]#######@#######@ " << endl;
cout << " *:+++++*##.+#@########***###@ " << endl;
cout << " +:++++++##W*#+W########@#***#@#### " << endl;
cout << " *:.++***###[emailprotected]##[emailprotected]#######@#**###*#@ " << endl;
cout << " .#:.:+*****#[emailprotected]@##**#####*#@ " << endl;
cout << " .,##:::*******######@#####*# " << endl;
cout << " ,..+##:+:*******#############**####@#####**#@ " << endl;
cout << " :...+:@#*:++*****############****#######@###**# " << endl;
cout << " .....:::@#+++****############****######**## " << endl;
cout << " :.....:::[emailprotected]@##*+++***##########*********# " << endl;
cout << " :......::+*::::####+::++*******## " << endl;
cout << " :.:...::*::::******@###@*:: " << endl;
cout << " :....:::.::**:::::***::::::*+:::*:*:+ " << endl;
cout << " :..:::::,,*::::::::::*::::*::::::**++ " << endl;
cout << " ::...:+:,,,,,:::::::::::::::::::::*++ " << endl;
cout << " :...:::,,,,,,WWW,:::::::::::WWWWW:#+* " << endl;
cout << " ***:+::,,,,WWWWWW::::::::::WWWWWWW**+ " << endl;
cout << " *.,:+:+,,,,,,WW,,,,,,::::,,,,WW,,,**+ " << endl;
cout << " *,,,+:+,,,,,,,,,,,,,,,,,,,....,,,++:* " << endl;
for(int x=1;x<=22000;x++);
gotoxy(1,1);
cout << " *:+++++*##.+#@########***###@ " << endl;
cout << " +:++++++##W*#+W########@#***#@#### " << endl;
cout << " *:.++***###[emailprotected]##[emailprotected]#######@#**###*#@ " << endl;
cout << " .#:.:+*****#[emailprotected]@##**#####*#@ " << endl;
cout << " .,##:::*******######@#####*# " << endl;
cout << " ,..+##:+:*******#############**####@#####**#@ " << endl;
cout << " :...+:@#*:++*****############****#######@###**# " << endl;
cout << " .....:::@#+++****############****######**## " << endl;
cout << " :.....:::[emailprotected]@##*+++***##########*********# " << endl;
cout << " :......::+*::::####+::++*******## " << endl;
cout << " :.:...::*::::******@###@*:: " << endl;
cout << " :....:::.::**:::::***::::::*+:::*:*:+ " << endl;
cout << " :..:::::,,*::::::::::*::::*::::::**++ " << endl;
cout << " ::...:+:,,,,,:::::::::::::::::::::*++ " << endl;
cout << " :...:::,,,,,,WWWWWW:::::::::WWWWW:#+* " << endl;
cout << " ***:+::,,,,WWWWW+WWW:::::::WWW*WWW#** " << endl;
cout << " *.,:+:+,,,W+:W#W W+W,,,::::[emailprotected]:W*W#** " << endl;
cout << " *,,,+:+,,,W+ W#W#W:W,,,,,,,W#[emailprotected]+W+:* " << endl;
cout << " *,:+,,+,,,*: W*W#W *,,,,,,,:*W#W*W+:* " << endl;
cout << " +,,.+,+,,,,*WW***W ,,,,,,,, ***WW+++* " << endl;
cout << " +,,,.,,,,,,,,*WWW#*,,,,,,,,*WWW,.+:* " << endl;
cout << " *.,,.:,,,,,,,,,,,,,,,,,,,,,,,,,,+** " << endl;
}
return(0);
}
I'm a beginner by the way and need help as soon as possible. I'm USING Turbo C++.
Here's a neater version:


[attachment DELETED by admin]If that is a *censored* picture, we can not help you! it isn'tI thought C++ required ending QUOTES. Is that not true?
THEE is a lot of wasted spaces.
Would you not want to compress it?
That is a terminal program, right?

1236.

Solve : Vista Games?

Answer»

:)HI
I was PLAYING with a vista machine and found some wonderful games, which are new to me. MY DD would love them. I would LIKE to KNOW, if there is a way to copy that game into WINDOWS XP?
Thanks One cant be sure that it would run if you copy directly. You need the installer of the game. You also need to verify whether the game is compatible witg XP.

Please note- Make your posts on the correct board, this one should have been on the "Games" board. Quote from: Ashutosh32 on May 01, 2009, 02:45:22 PM

One cant be sure that it would run if you copy directly. You need the installer of the game. You also need to verify whether the game is compatible witg XP.

Please note- Make your posts on the correct board, this one should have been on the "Games" board.


Sorry I hope to READ more attentativly at the Advisory boards. Thanks for informing me with regards to compatability. I am glad that I could help you. Good luck with the game, let us know when your DD is happily gaming.
1237.

Solve : C++ Header problem?

Answer»

I am trying to create an "all inclusive" header so i only need to type #include "all.h" at the beginning of a PROGRAM

As I am still LEARNING, i only have three things in all.h atm which include:

Code: [Select]ifndef ALL_H
DEFINE ALL_H

#include <iostream>
#include "stdafx.h"
#include <cstdlib>

endif

and in my main project i have:

Code: [Select]#include "all.h"

int main()
{
//code
}


but when i try to compile the program i get this error:
Code: [Select]d:\c++ projects\helloworld\helloworld\helloworld.cpp(1) : warning C4627: '#include "all.h"': skipped when looking for precompiled header use
Add directive to 'stdafx.h' or rebuild precompiled header
d:\c++ projects\helloworld\helloworld\helloworld.cpp(12) : fatal error C1010: unexpected end of FILE while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?

it is a short file... and line 12 would be directly after the } ending the main() but nothing is there.

So, I am asking if I have my header setup right, and is it even POSSIBLE to do what I am trying to do?

1238.

Solve : c++ system command?

Answer»

Where is the best place to go to learn how to use SYSTEM COMMAND in C++?
Also, can I call values from a file and use them within this command?
hybridsealy(at)comcast.net
Thanks:)You MEAN the function

system(const CHAR*)

?I guess. I WANT to use it to take LINE COMMANDS in a data file and make them useable line commands. Will that work with that command?Is it that your program will read a file(which would hopefully have DOS commands) and execute them with system function?

1239.

Solve : Make me understand?

Answer»

Hi Geeks!!

What's the Buzz going on for "Cloud COMPUTING"? Google is actively involved, PANDA Security Systems have released a "New Beta" Antivirus Product based on the same.....!

Just look at the messy definition(attached) offered by Wikipedia that nevertheless PROVES to be a "BOUNCER" for a normal folk!

Can someone please decipher "Cloud Computing" in the most simplest of terms!?

[attachment deleted by ADMIN]This help??? http://www.webopedia.com/TERM/C/cloud_computing.htmlQuote

Make me understand
Well, I could beat you with a rubber hose and tell you it is for your won good.
Should that help?
Cloud computer is about taking away your PC and punishing you if you want it back.

Read this link before it is banned!
http://www.infoworld.com/d/cloud-computing/cloud-computing-inherently-evil-409

Yes, I do a lot of joking here. But this is not a JOKE. Please look over what he says. The infoworld people are good thinkers. Take a look.Hey Guys!

Pls don add on to the "Trouble"! I have got the simplest one through FAQ of Panda's Pioneer contribution i.e. their new Cloud- Computing based Antivirus!

Just check-out the attachment...!

Do not spill more "Bouncers"...please!

[attachment deleted by admin]
1240.

Solve : file manipulation C++?

Answer»

I was wondering how a person could take a line command, and store it into a data file as text, and then access that text later and MAKE it an actual command within the program later. Any thoughts?you doing this for homework?Sort of. I need to learn how to do this. I want to CONSTRUCT some kind of program where I can do a creative graphically and MUSICALLY INTERACTIVE application. I need someone to help me with SPECIFIC questions when I run into snags. If you can help me with this, then I am at hybridsealy(at)comcast.net Thanks.

1241.

Solve : Creating an Array of a structure?

Answer»

Hopefully I can make this as simple as possible.
I need to create an Array of a structure( which basically holds the information from the summary form)
and I am having issues as to where to put the code.

1) My project has 3 forms, a mainform, a summary form and splash screen.

2) I need to print the table on a print preview invoice

3) I need the summary form to still show summary totals

So here is my QUESTION, do I put the code simply in the PrintDocument1_PrintPage event?

Does it make sense what I am asking? * Note I am NOT asking for the anyone to write my code*
THANK you
Are you using an existing solutions for a task?
Or is this an exercise is how to solve a problem?
There are already many report generators.
Foxbase comes to mind.I am to use an existing solution yes.
My issue is when I follow my BOOKS example, my calculations are incorrect and my summary form does not work. Mainly due to the example in the book NOT have a summary form. I do believe I can tweak my code to still show my summary form though.

My current error is " Array Intializer has too few DIMENSIONS"You are using Visual Basic for you task.
You can have the IDE (Also called the Integrated Development Environment) give you help on this. You can ask for help with an error message and the Visual Basic editor will OFFERS some advice. You will need to pay attention to how the DIM is used to build an ray for several declensions.
But, in a structure each array may be of a different type, so you must find a way to provide enough DIMS of the right type for the structure.
That is a much as I can tell you.

1242.

Solve : How can I design a program in VB 6.0 to backup all Excel or Word files??

Answer»

Dear Sir

I want to design a program in VB 6.0 that will BACKUP all .xls and .doc files in a specific LOCATION at a specific time automatically.

Please help by providing the code.


Regards
talorababuhomework ? project? What do you want more?

Something to backup your office files, or to learn from the source code of a program like that?

If you want a backup application, there's plenty out there.. Just a few keyboard clicks into Google and you'll be flooded with them. I use Backup4All Professional.

If you're looking for source code, there are a few WEBSITES out there like PlanetSourceCode.com that may have what you're looking for. If not, get bits and pieces from different CODES and use your knowledge to blend it all TOGETHER to make what YOU want

1243.

Solve : how to know minimum system requirement of a c++ programme?

Answer»

hi myself MOHAMMAD MIYAN
i am pursuing MCA

i have developed a mini project in c++.now i want to know how i may know MINIMUM system requirement of the system that can run my mini project.
as usually written on every software

i want to specify minimum system requirement for my project.
i know it runs on every MACHINE but just for knowledge.
most of the time, if your just starting off, any program you make will work on your computer.
The system requirments wont matter until you GET up to REALY big programs that use graphics.

so as long as you can use the compiler your computer should be able to handle any c++ program that doesnt use graphics.

1244.

Solve : [C++] In the statement -- -- What does i++ mean??

Answer»

-- The statement is
for ( int i = 2; i < 30; i++ )
{
--
Based on my assumption, i++ means i+1... but -- I don't code in C++ at all.
i++ mean post increment. equivalent to i=i+1

edit: it means "use the value of i first, then increment"Quote from: gh0std0g74 on April 24, 2009, 10:05:27 PM

i++ mean post increment. equivalent to i=i+1
Like in batch,

set /a num+=1Quote from: Helpmeh on April 25, 2009, 10:25:19 AM
Like in batch,

set /a num+=1

C++ is NOT like batch at all.Quote from: Geek-9pm on April 25, 2009, 06:23:26 PM
C++ is NOT like batch at all.

I THINK he meant to say that set /a num+=1 is the batch equivalent to the C++ command, does same type of thing. Quote from: x2543 on April 25, 2009, 06:40:59 PM

I think he meant to say that set /a num+=1 is the batch equivalent to the C++ command, does same type of thing.

OK, I see what you mean. On my computer
set /a num=+1
gives the value as 1
Maybe he meant
set /a num=num+1
Or did I miss something? What did I miss?
Quote from: Geek-9pm on April 25, 2009, 06:51:39 PM
OK, I see what you mean. On my computer
set /a num=+1
gives the value as 1
Maybe he meant
set /a num=num+1
Or did I miss something? What did I miss?

set /a num+=1 and
set /a num=%num%+1
are the same thing. It will return 1 because a blank variable is equaled to 0, but also a blank line. In math, it's equaled to 0, but with ECHO it counts as nothing being there.i++;

simply mean
i=i+1;
i++; will just increament value of i by 1.

in c,or c++
i++,++i are same if. if they are not used with other variable.
in the same way --i,i-- are same.

consider
i=5;
i++;

now the value of i is simply 6;
i=5
++i;
again value of i is 6;

but u just consider statement
i=5;
c=i++;
the value of c is 5, i is 6.
i=5;
c=++i;
the value of c is 6,i is 6;++ is an unary increment operator which INCREMENTS the value of the operand by 1. I'd recommend reading books about C++. Quote
books about C++.
So if I go to the library and ASK for a BOOK about C++
they will give me a book about D
Which comes after C.
Is that right? Quote from: Geek-9pm on April 28, 2009, 10:16:02 AM
So if I go to the library and ask for a book about C++
they will give me a book about D
Which comes after C.
Is that right?

very funny Never knew your librarian uses a C++ compiler for everything that is told. Anyways you should get "Expression syntax" because "give" or "me" or "a" or "book" or "about" or "C++" none are valid in C++ syntax. Try
Code: [Select]library.getBook("C++ for dummies");
If that fails refer to the manual for that librarian.
1245.

Solve : How to code registry modifier (logic wise)??

Answer»

I am about to finish my first year learning programming, so basics are covered in C#. I would like to code a registry modifying application, but I don't know how to! I'll be able to find the file but that's about it.

Can SOMEONE kind of lay out the logic steps to entering the registry file and how to modify a value?

Thanks in advance.Quote from: ultimatum on April 28, 2009, 07:02:06 PM

... registry modifying application....
... the logic steps to entering the registry...
We wish you the best. But what you have is know as a
Programming Paradox.

Common usage makes if DIFFICULT to put Logic and Registry in the same paragraph. Or page. If it follows logic, it would not be part of the Windows Registry. That is why the Registry exists, to deal with things that do not follow logic which is brother of reason.
Anyway, look here:
http://support.microsoft.com/kb/136393

Of course, I could be wrong.
That conclusion needs logic and reason.


Interesting, I guess it makes sense. Overall I know how to modify registry myself. Thanks for clearing this out.Quote
Common usage makes if difficult to put Logic and Registry in the same paragraph. Or page. If it follows logic, it would not be part of the Windows Registry. That is why the Registry exists, to deal with things that do not follow logic which is brother of reason.
Anyway, look here:






what?


Please explain.Quote from: BC_Programmer on April 28, 2009, 08:17:07 PM

what?
Please explain.

HI BC
Can you give me a recommendation as to what source material one would study for the Windows Registry. VISTA preferably.
Try Amazon or Barns &AMP; Noble and search Windows VISTA registry.

Let me know which is the logical, book of reason and I will get it and read.
If it is logical, reasonable and mostly complete,
I will eat my tail feathers. (With salt.)

And if nobody has yet to write such a GUIDE, I rest my case.
the fact that there is no guide is because it's simply a heirarchal tree structure. There is nothing illogical or without reason about it- it's a central storage repository for settings.


The thing is- it really didn't matter what MS had done- if they had, for example, stayed with INI files, then everybody would be complaining about that.Quote
There is nothing illogical or without reason about it- it's a central storage repository for settings.
I was hoping you would recommend some light reading.
Well, the TS wanted to have a simple guide. Or a step by step. As far as I know the Registry does not give you an error message if you do something dumb. Here is something anybody can try. Modify the drive letter of your BOOT partition. Make if , say D: or E: instead of C: because it is only a setting, not an absolute reference. -Right?
Here is a step by step:
http://www.petri.co.il/change_system_drive_letter_in_windows_xp.htm

Also, notice the links he gives at the end of the article. Must read.

For some strange reason MS recommends that your make a backup of the registry. Is that logical? If it is, why don't people do it?

Quote
For some strange reason MS recommends that your make a backup of the registry. Is that logical? If it is, why don't people do it?

people often won't back-up their own work. Only very dutiful users back-up their computer's work.


Quote
I'll be able to find the file

does this mean you want to literally open the DAT files and try to parse their contents?


1246.

Solve : Is it possible to hear sound included in word doc after converting it into pdf?

Answer»

I have written a Ms word document where I have included an wav file. When I am converting this file into
pdf format, I am unable to get the sound. How to solve?

thanks
DevduttaaYou cannot put sound in a PDF.How does relate to proggin' anyways?Quote from: Carbon Dudeoxide on March 26, 2009, 09:33:23 AM

You cannot put sound in a PDF.

Actually you can. I know in Adobe Acrobat Pro there is a Multimedia option. I haven't played with it much, but I know it is there. Quote from: Griff on April 27, 2009, 03:58:31 PM
Actually you can.

Pretty bold statement from someone who hasn't played with it much...

Let me see if I can find something...

HTTP://www.youtube.com/watch?v=n16lbi4YEqA

he he he... that counts right?Interesting.....But the program isn't free, is it?It's Adobe Acrobat. I don't think there's a free version of that. Then again, I have no idea what program devduttaa is using....

Might help a bit if we knew so we could look into it. PDF does support it, but does his converter?


Side thought: It's annoying enough when a web page starts talking to me, but if my BOOK wants to start a conversation? I'm gonna jump off a cliff.... If it was just a few pages and if the PDF options were not needed, LIKE zoom, copy etc. In that case one would just convert the thing into a nice little show in SWF format. Takes, maybe, more file SIZE, but you can have audio like in a power point presentation. The user could only go to the next or back to the start or QUIT.
1247.

Solve : C# -- List.add help?

Answer»

I have a list of points that I wish to start ADDING points to -- so how would I do it?

I KNOW how to use one, but I always get an error upon runtime... I believe I included enough.

--Liam

P.S. I'm using C#.NET if that makes a a difference.
Code: [Select] bulcount++; //adding one to the bullet count, since the action is triggered at space-press
double X = 0, y = 0; //creating our doubles
//White space is good
x = Math.Atan(MS.X - v.X); /* Getting the ANGLE
y = Math.Atan(MS.Y - v.Y); */ for the two coordinates
//MORE WHITE SPACE!
bulvecs.Add(new point((int)x, (int)y)); //adding the list, get an error upon runtime

1248.

Solve : Scripting for IRC bots.?

Answer»

Can anyone, teach me, or show me, how to script for IRC Bots? I want to make my own .

EDIT: NEVERMIND .You'd USE TCL or st like that, mainly. Get holda some cook.Sorry, "book". READ.

1249.

Solve : WordBasic Command in Word 2007?

Answer»

Hi everyone, I have a .Dot file designed in Word 97, and it includes Macros and get the data from a .DAT file.

The point is that I need that this file works correctly with word 2007 but it doesn't.

I think that I have some mistake on the CODE WordBasic (Did you KNOW if the code structure has change? Like VB.net for example)

Best Regards

1250.

Solve : c++ and ASCII?

Answer»

hi,

I need help with how to display the ASCII code for a character in c++. I'm new to the syntax of c++ and it's driving me mad. Also I need a PUSH in the right direction for writing a program that READS in a " " as a character. What sort of data type should I use. I'm not asking for the code for this program just a push in the right direction, I do want to figure most of it out myself. I guess that I'm stuck atm.

Thx main()

{
int c;
c=GETCH();
cout<<"\NTHE ascii code for the key you PRESSED "<
getch();
}

this code will show you the ascii code of the key that you've pressed

eg ascii code for a is 65;



mohammad miyan
amu
aligarh