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.

2001.

Solve : Modem speed command?

Answer»

i waz wondering if there was a command(or function) that DETERMINES and tells you the average speed of a modem, while its downloading stuff. but is there such a function or command and on WAT prog languege?UH... doesn't it SAY when you are downloading...? (downloading at 5 kbs / sec)yea, it does.
but im wondering how can you determine the speed of your modem while its downloading something in your program.In XP you have the Windows performance counters which you can access, including the number of BYTES downloaded & uploaded in the previous second

2002.

Solve : how to i make a batch file start when i login?

Answer»

im fairly new at batch and i have made a program and i want to make it so that it will run automatically when i log in. how do i do this?On a Win9x machine, put a reference to the file in your autoexec.bat file found in the root directory of the boot drive.

On a WinNT machine, create a shortcut or drag the file to your startup folder found on the start menu.

Place a line in your autoexec.bat that calls the batch file each time you want to boot the computer. For example:

CALL C:\myfile.bat
vishalsaxena17 please notice the last time a thread was active before adding to it. There is no POINT in bumping up a 2 month old thread. The original poster is long gone.
« Reply #1 on: JANUARY 29, 2008, 20:09:10 »sorry BUDDY , i jst dnt noted when it was posted last.

2003.

Solve : Net meeting from "windows vista" to "windows Xp"?

Answer»

hi to all,
1 questn.> i want to have net meeting from my WINDOWS VISTA (64 bit) machine to a machine is having a windows Xp(32 bit) as a operating system.


2 questn > from Windows vista (64 bit) machine to a machine is having a Windows vista (32 bit) as a operating system

hoping for a quck reply.I don't get it, what is your QUESTION?
And what is the difference between question 1 and 2?hi dear thankx that u have a LOOK to my querry.
in first question the net meeting is between vista - XP machine
in second question the net meeting is between Vista - Vista machines.

kindly note the bit that i hav mentioned.

thank u
Netmeeting isn't available in Vista.

2004.

Solve : scripting Vs programing?

Answer»

Can ANYBODY please tell me the difference between scripting and programing.
also what is the difference between scripting language and programming language.

I have checked google, but I am still not clear.
Please help me out.

Thanks in advance.http://en.wikipedia.org/wiki/Scripting
http://en.wikipedia.org/wiki/Programming
http://www.killersites.com/blog/2005/scripting-vs-programming-is-there-a-difference/Quote from: Tripti on January 23, 2008, 12:53:55 AM

Can anybody please tell me the difference between scripting and programing.
also what is the difference between scripting language and programming language.

I have checked google, but I am still not clear.
Please help me out.

Thanks in advance.
you should not be too concerned about their differences. What matters is WHETHER you can get them to do what you want. scripts are used on the web like JavaScript.
programs are used on the computer just the computer, but programs can be used in small networks.Quote from: macdad- on February 05, 2008, 02:21:29 PM
scripts are used on the web like JavaScript.
programs are used on the computer just the computer, but programs can be used in small networks.
Actually the line isn't that clear.
Many scripting languages are not for web use. Like Windows' own scripting languages Batch, VBScript and Powershell.
And some programming languages can be used on web sites.. like Java or Silverlight.
Quote from: Deerpark on February 06, 2008, 12:53:59 PM
Actually the line isn't that clear.
Many scripting languages are not for web use. Like Windows' own scripting languages Batch, VBScript and Powershell.
correction. Vbscript is used in ASP. so yes, it can be used for the web.
Oh yeah so it is.
And speaking of ASP it really adds to the CONFUSION since you can use all the .NET programming languages in ASP.NET."A scripting language, script language or extension language, is a programming language that controls a software application. "Scripts" are often treated as distinct from "programs", which execute independently from any other application. At the same time they are distinct from the core code of the application, which is usually written in a different language, and by being accessible to the end user they enable the behavior of the application to be adapted to the user's needs. "

i have quoted this from "http://en.wikipedia.org/wiki/Scripting_language"
n i think it is also clear from WAT is stated above.
thnk u
2005.

Solve : C++ help?

Answer»

Hello.
I have just started C++
I downloaded a compiler called Code::Blocks. My first question is, is this the best FREE compiler for someone who is just starting out in C++?
My second question is; how do I make a application that will run in FULL screen???
My next question is; when I want to make a new project in Code::Blocks, it comes up with a WHOLE bunch of options. There are things like "Console Application", "Dynamic Link Library" and many more. What do they all mean?
thanks
bubbz for a good free ide and compiler read more here http://www.bloodshed.net/devcpp.html

i dont know about a fullscreen window, but try this.. (fullsize app window)

#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <Wincon.h>
#include <string>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cctype>
using namespace std;

int main()
{
HWND hWnd = GetConsoleWindow();
ShowWindow(hWnd,SW_SHOWMAXIMIZED);

string str = "UPPER-CASE";
transform(str.begin(),str.end(),str.b...
cout << str << endl;
cin.ignore();
return 0;
}
if you experience problems with that.. wait till someone ELSE comes around , im still a noob to C++ myselfDownload Microsoft Visual C++ 2008 Express Edition from the microsoft website. Still the best.

http://www.microsoft.com/express/download/default.aspxi have the code in here somewhere... lol ive found a ton of different free things off the net

Quote

#include <cstdlib>
#include <iostream>
#include <windows.h>

using namespace std;

int main (int argc, char *ARGV[])
{
keybd_event(VK_MENU,0x36,0,0);
keybd_event(VK_RETURN,0x1c,0,0);
keybd_event(VK_RETURN,0x1c,KEYEVENTF_KEYUP,0);
keybd_event(VK_MENU,0x38,KEYEVENTF_KEYUP,0);
system("pause");
}

I use Dev cpp...turbo c++ is the best compiler.
an i am unable to understand wat do u mean by "full screen" is that u want to run application having GUI?
2006.

Solve : displaying a graphics file?

Answer»

Perhaps some one can SUGGEST the simplest manner of writing a program which displays a graphics file, such as a gif file. Let's assume that I understand the manner in which the pixels are stored in a gif file. Let's assume that I can utilized any common programming language, such as C++, or QBasic, or assembly language.

I would appreciate any replies, thanks.why don't you just USE a PICTUREBOX?

MyPictureBox.Image = System.Drawing.Image.FromFile("C:\Mypicture.gif")

2007.

Solve : please help for loop statement?

Answer» GUYS give me a code of for loop statement please..you write the whole code in c++ structure....thxTry this and this and any of the other 398,998 hits on Google.

Good luckin vb6 its (for an endless loop that eventually freezes the program)

Quote
theplaceuwanttogo:
beep
goto theplaceuwanttogo


1) theplaceuwanttogo: symbols the goto 2 lines down where to go back to
2) beep --- simple system beep, but gets annying when repeated
3) goto theplaceuwanttogo --- telling the computer that once it reaches line 3 to simply "goto (PLACE)" then put the place SOMEWHERE elce...

but this is vb6 so its probably different... i just felt LIKE posting Yuck!!! Goto!!! The start of spaghetti coding...LOL Yuck indeed Dusty. The scourge of goto needs to be stopped. for more interesting results try


Code: [Select]Do while True
Dim x as String = InputBox("Enter password")
If x = "Some Text" then Exit Do
Beep
Msgbox("Incorrect Password.")
Loopgrr **shakes fist**

im still a bit new at this
2008.

Solve : I have a vb6 game im working on... cant get player to go to another room.?

Answer»

i have 2 objects on my program, an IMAGE NAMED IMAGE1, and a label, named label1. how do i get it when the 2 collide to open a new form, form2.

im not an utter noob at vb6, but just learning the basics... hence the name Visual BASIC 6... This appears to be an exercise in tenth grade geometry. TRY tracking of the x,y coordinates of each corner of the label, and the area coordinates defined by the image. When they intersect, you have a collision.

Check out the property sheets of both the image and the label. You should be able to extract all the information you need for your calculations.

Good luck. i FOLLOWED enough of that to get it to work

but im not in tenth grade yet; im only 13

2009.

Solve : Autonumber problem in Access database?

Answer»

I exported data from an Access DATABASE to Excel, manipulated the data, and then imported it into a modified version of the original Access database. The imported data contained the original autonumbers assigned to each record. When a new record was added, the AUTONUMBER assigned to the record wasn't the next consecutive number. It wasn't even close.

Can someone help. Let me know if you need more information. I may not have explained this problem very well.

Quote

and then imported it into a modified version of the original Access database

How did you MODIFY the database? UNLESS there is a relationship between the data and the autonumber there is no reason to reset it.

If you MUST reset the autonumber, you can try this.

2010.

Solve : Deleting Files Using Vbs?

Answer»

I am kind of new to visual basic script and I am wondering how I can delete files and folders using it? Is there a delete command?i know there is the Kill command, but thats for processes... gime a sek i have tons of old code on my pc...

lol this is from the most intricate program ive ever made... so far... but im working on a game so its going to lose its spot

To create a file, txt in this instance
Code: [Select]Dim namefile As String
namefile = Text1
If Text1.Text = "" Then
MsgBox "fill in a username"
Else
If Text2.Text = "" Then
MsgBox " fill in a password"
Else
Open App.Path & "/Accounts/Users/" + namefile + ".txt" For Output As #1
Print #1, Text1.Text
Print #1, Text2.Text
Close #1
End If
End If


nope i was wrong... kill does work for files
Code: [Select]Kill App.Path & "\Accounts\Users\" + "openfile.txt"
MsgBox "Deleted"
Explanation:

Kill-- MEANS delete
app.path --- means open the directory the program is located
& "\accounts\users\" --- means to open these folders ON TOP of the application path such as C:/game/ , but instad it would open c:/game/accounts/users
+ --- the file you wish to delete, but in COMPUTER it means AND
"openfile.txt" --- SIMPLY naming the file were getting rid of


I HAVE NOT TRIED THE FOLLOWING SO DONT SAY "YOU WERE WRONG"

i think that if you REMOVE everything after the + sign including the + sign it will delete the folder... but im not positive...You can use methods of the file system object for both files and folders:

Files:
Code: [Select]Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFile filespec, True

Folders:
Code: [Select]Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFolder folderspec, True

Replace filespec and folderspec as needed. The True parameter will force the delete on read-only files/folders.



PS. VBScript does not have a kill instruction.

2011.

Solve : Batch in Vista\ REALLY NEED YOUR HELP?

Answer»

Hi, and thank you for reading that.
I wrote a small app to "change ip" on my computer in batch.
I have 3 dial-up connections, and each one should give another ip every time I disconnect and connect, but it doesn't happen so recently, so I had to do something.
I wrote this app:
*It works perfectly on XP! for 100%

http://utilitybase.com/paste/6200

*this slash: / should be: \
but I don't know whats wrong with the site I uploaded it to.


As you can see in lines 37-39,

:files_are_the_same
cd "C:/Program Files/program"
0142.bat


If the IP hasn't been changed, it goes to the next dial-up connection named as [0142.bat and 0143.bat].

[0142 and 0143 are has the same content as the app you saw, but it connects just to another connection]


The problem in Vista is that it does only the first "loop" - it doesn't go to the next file [connection...].
For example, even if the IP wasn't changed it stops in 0141 and doesn't go on to 0142 and etc.

Why is that? Why it doesn't read the IF's? How to fix that?

Thank you a lot again!!
sorry for my ENGLISH, if it's not so correct. If you didn't understand something please write it, and Ill to to rephrase it.

Very nicely written code. Very readable.

I can't really see a loop. Just a return to :files_are_the_same. There are no variables so repetitively running code will produce the same results each time.

Some interesting code:

Code: [Select]:connect
rasdial "0141" "USER" "PASSWORD"
rasdial "0141" "USER" "PASSWORD"
IF NOT ERRORLEVEL 0 goto files_are_the_same
IF ERRORLEVEL 0 goto curl1

Should you not be checking errorlevel 1?

Code: [Select]:files_are_the_same
cd "C:/Program Files/program"
0142.bat

This a transfer of CONTROL to the 0142.bat file. Is this what you want? Without a call, control will not be transfered back here.

Thank you for the fast reply!

Yes, sorry , I didn't mean loop, I meant that if something goes wrong it should go over and over
through 0141->0142->0143->0141... ... ...

Quote from: Sidewinder on March 10, 2008, 04:38:16 PM

Very nicely written code. Very readable.

Thank you very much


Code: [Select]:connect
rasdial "0141" "USER" "PASSWORD"
rasdial "0141" "USER" "PASSWORD"
IF NOT ERRORLEVEL 0 goto files_are_the_same
IF ERRORLEVEL 0 goto curl1

Should you not be checking errorlevel 1?

Isn't that the same? ERRORLEVEL 1 and NOT ERRORLEVEL 0 ?

Code: [Select]:files_are_the_same
cd "C:/Program Files/program"
0142.bat

This a transfer of control to the 0142.bat file. Is this what you want? Without a call, control will not be transfered back here.

umm... It works on XP.
I just want it to open 0142.bat in the same cmd window. just to continue running the commands that are written in 0142.bat in the same cmd window




I can't understand, why is that working on XP for 100% and not working on Vista at all.
I mean it is working, but it runs only the first opened file 0141.bat, and it doesn't matter what is the result [I mean whether it has changed the IP or not] it won't go on to 0142.bat.

Why :S ?It's doubtful Microsoft would change batch file behavior for Vista. Try turning echo on; by scrolling back the cmd window you should be ABLE to see how the file runs and what paths it follows on the if statements. The errorlevel values seem to be the only decision making logic points in the file.

Quote
:connect
rasdial "0141" "USER" "PASSWORD"
rasdial "0141" "USER" "PASSWORD"
IF NOT ERRORLEVEL 0 goto files_are_the_same
IF ERRORLEVEL 0 goto curl1


Should you not be checking errorlevel 1?

Isn't that the same? ERRORLEVEL 1 and NOT ERRORLEVEL 0 ?

If I read this right (no pun), the first if checks for negative errorlevels (not 0 and not greater than zero); the second if checks for zero and positive errorlevels. Negative errorlevels are possible but rare. My guess is you always end up in :curl1. If this is correct, then fine. You may want to check this though.



Quote
Isn't that the same? ERRORLEVEL 1 and NOT ERRORLEVEL 0 ?

"IF errorlevel 1" means "if errorlevel is 1 or greater", and "If not errorlevel 0" means "if errorlevel is not equal to 0"
2012.

Solve : outlook vba quesiton...?

Answer»

Ok, I was thinking of running the vba in powerpoint so as to leave outlook free, though I do not know what effect looping code in VBA with one microsoft program does to the functionality of other MS programs. I GUESS unless you were willing to let the vba in outlook start up powerpoint and then let it go "hands fee" you would probably have the same problem no matter which ms program was running the original code.Quote

Since it's working now and it 's only intended to be used for the next 2-3 weeks I'll probably leave it there, but not bad for a first timer!!!

Congrats! You'll be a whiz by the time March Madness 2009 rolls around. Quote from: Sidewinder on March 11, 2008, 03:47:27 PM
Congrats! You'll be a whiz by the time March Madness 2009 rolls around.

There is talk of leaving one of the machines with this on, as the sales manager is well impressed. I think he's trying to blag a 50" screen for the display as we speak.

I might have ago at tiding it up a little.

If I posted all the code, would you guys run your eye's over it?? let me know if I could make any changes to improve it??

cheersI'm willing to look it over, and not just because I could use it to set up a movie clip to play on my comp everytime I get new mail . I figure it helps to have someone else go through your code as their logic may be different from your own and they may also know of shortcuts that you don't.outlook code (main PAGE)

Code: [Select]Public WithEvents TargetFolderItems As Items
Public path As String


Private Sub Application_Startup()

'Declare MAPI folder
Dim ns As Outlook.NameSpace

'Set the default folder
Set ns = Application.GetNamespace("MAPI")
Set TargetFolderItems = ns.GetDefaultFolder(olFolderInbox).Items


Set ns = Nothing


End Sub

Private Sub TargetFolderItems_ItemAdd(ByVal Item As Object)



'Declare attachment & sender variables
Dim olAtt As Attachment
Dim olApp As Outlook.Application
Dim olNs As Outlook.NameSpace

Dim olMyParentFolder As MAPIFolder
Dim olMoveToFolder As MAPIFolder

Dim olNewItem As Object
Dim olSubject As String
Dim olsubjectna As String
Dim olsubjectna1 As String
Dim olsubjectna2 As String
Dim olAttach As String
Dim sender As String

Dim olDate As Date

'exit sub if undeliverable message as errors
olsubjectna = "Undeliverable*"
olsubjectna1 = "Read:*"
olsubjectna2 = "Not Read:*"

If Item.Subject Like olsubjectna Then
Exit Sub
End If
If Item.Subject Like olsubjectna1 Then
Exit Sub
End If
If Item.Subject Like olsubjectna2 Then
Exit Sub
End If



'Declare the sender address
'sender = "[emailprotected]"



'declare subject criteria (march madness File)
' looks for subject containing "Projection"
olSubject = "*March Madness*"

'If Item.SenderEmailAddress = sender Then
'When a new mail comes into the inbox check to see if it has an attachment and evaluate the sender
'Select Case Item.Subject
'is the mail subject _SALES_TARGET_UPLOAD?
'MsgBox "Mail Received!"

If Item.Subject Like olSubject Then


'pass file/path VARIABLE to IsFileOpen function. If True
If IsFileOpen("C:\march madness\March.ppt") = True Then

'MsgBox "condition correct!"
'saves and close's current open ppt
Set objppt = CreateObject("PowerPoint.Application")
objppt.Visible = True
Set objPresentation = objppt.Presentations("C:\march madness\MM Projection v 2.ppt")
objPresentation.Saved = True
objPresentation.Close
objppt.Quit


'MsgBox "Powerpoint closed"

create_directory


End If

Set olAtt = Item.Attachments(1)
olAtt.SaveAsFile "C:\March Madness\" & olAtt

'MsgBox "file saved"

Set objshell = CreateObject("Wscript.Shell")
objshell.Run "C:\powerSTART.bat"

End If

Set olApp = Nothing
Set olNs = Nothing
Set olMyParentFolder = Nothing
Set olMoveToFolder = Nothing
Set olNewItem = Nothing
Set olAtt = Nothing


End Sub

outlook modual code;

Code: [Select]'declare application and workbook variables
Public objExcel As PowerPoint.Application
Public objWB As PowerPoint.Presentation
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Sub create_directory()

'MsgBox "GOT to create directory"

'checks if the march madness folder exist

Dim PoExists As Boolean

'pass arguments to function
PoExists = FileOrDirExists("C:\march madness\")

'if the path(s) don't exist, create directories
If PoExists = FALSE Then
MkDir ("C:\march madness\")
End If


End Sub




Public Function IsFileOpen(FileName As String) As Boolean

'this function checks to see if a file is already open
'returns true if open

'declare variables
Dim iFilenum As Long
Dim iErr As Long

'check for lock file
On Error Resume Next
iFilenum = FreeFile()
Open FileName For Input Lock Read As #iFilenum
Close iFilenum
'assign number
iErr = Err
On Error GoTo 0

'select the outcome
Select Case iErr
Case 0: IsFileOpen = False
Case 70: IsFileOpen = True
'file not found
Case 53: IsFileOpen = False
Case Else: Error iErr
End Select

End Function

Sub delete_from_imported_dir()

On Error GoTo ErrHandler

'delete all files from imported extracts directory
Kill "C:\Oracle VB\Sales Target Upload\Imported Extracts\*"

'if no files in the directory exit sub (err_number 53)
ErrHandler:
Exit Sub

End Sub

End Sub

Function FileOrDirExists(PathName As String) As Boolean

'function returns true if the specified directory/file exists

Dim sTemp As String

'Ignore errors to allow for error evaluation
On Error Resume Next
sTemp = GetAttr(PathName)

'Check if error exists (0 = exists)
Select Case Err.Number
Case Is = 0
FileOrDirExists = True
Case Else
FileOrDirExists = False
End Select

'Resume error checking
On Error GoTo 0

End Functionbatch file starting vbs:

Code: [Select]@echo off

ping localhost 2 >nul

start c:\power.vbs

exit


vbs code starting powerpoint:

Code: [Select]Dim strComputer, strProcess, strProcessID

strComputer = "."
strProcess = "wscript.exe"

Function IsProcessRunning( strComputer, strProcess )
Dim Process, strObject
IsProcessRunning = False
strObject = "winmgmts://" & strComputer
For Each Process in GetObject( strObject ).InstancesOf( "win32_process" )
If UCase( Process.name ) = UCase( strProcess ) Then
IsProcessRunning = True
strProcessID = Process.ProcessID
' Wscript.Echo "Process ID: " & strProcessID
Exit Function
End If
Next
End Function





If( IsProcessRunning( strComputer, strProcess ) = True ) Then

' Wscript.Echo "Killing " & strProcessID

' ------ SCRIPT CONFIGURATION ------
intPID = strProcessID

' ------ END CONFIGURATION ---------
' WScript.Echo "Process PID: " & intPID
set objWMIProcess = GetObject("winmgmts:\\" & strComputer & _
"\root\cimv2:Win32_Process.Handle='" & intPID & "'")
' WScript.Echo "Process name: " & objWMIProcess.Name
intRC = objWMIProcess.Terminate()
if intRC = 0 Then
powerpoint
end if
End If


sub powerpoint()

' Wscript.echo ("starting powerpoint")

Const ppAdvanceOnTime = 2
Const ppShowTypeKiosk = 3
Const ppSlideShowDone = 5

Set objPPT = CreateObject("PowerPoint.Application")
objPPT.Visible = True

Set objPresentation = objPPT.Presentations.Open("C:\march madness\MM Projection v 2.ppt")

objPresentation.Slides.Range.SlideShowTransition.AdvanceTime = 5
objPresentation.Slides.Range.SlideShowTransition.AdvanceOnTime = True

objPresentation.SlideShowSettings.AdvanceMode = ppAdvanceOnTime
objPresentation.SlideShowSettings.ShowType = ppShowTypeKiosk
objPresentation.SlideShowSettings.StartingSlide = 1
objPresentation.SlideShowSettings.EndingSlide = 2
objpresentation.slideshowsettings.loopuntilstopped = True


Set objSlideShow = objPresentation.SlideShowSettings.Run.View


Do Until objppt = SlideShowEnd
If Err <> 0 Then
Exit Do
End If
Loop

WScript.Quit

end sub


enjoy!!! Yikes! You certainly do get knee deep into the code. If it works, don't change a thing. Perhaps you could persuade your boss to pay you by the word!


2013.

Solve : Intro to C++?

Answer»

Hi folks

I have got an asigignment, which consists of a C++ program. Some code is already given to us, and we need to modify it. So I STARTED a NEW project on my computer, and pasted the main code in it.
But the code which was given to us consisted of 3 parts. Two sources and a header.

What should i do exactly with these?

Thanks beforehand Hi SimonA.

As an unwritten PRINCIPLE we do not normally involve ourselves in homework ASSISTANCE. This is between the student and his/her TUTOR. If you do not understand the assignment you should approach your tutor for guidance.

However, I suggest you Google for C++ tutorials and try to find an answer in one of the 400k+ hits.

Good luck.

what is the problem?

2014.

Solve : In java?

Answer»

I WANT a java SCRIPT that does, wheni refresh my page an alert POPS up asking for conformation with two options namely "YES or NO"

Please outI don't know Java myself... but I do know a person who has a partial degree in it, and they can be FOUND at http://z15.invisionfree.com/ISURA_Solutions

Sorry, I only know vbscript... It would be easy in that if you are interested

2015.

Solve : C++ loading questions?

Answer»

I am THINKING about making my own program that protects my COMPUTER from viruses, but I need help with 1 THING right now.

How do I MAKE it so it loads each time WINDOWS starts?
So that when I turn the computer on, each time it will start working.

Thanks,
S_R_SPut it in your statup folder
e.g.
start|all programs|startup

2016.

Solve : A simple Excel spreadsheet (without Marcos) than can predict 3-digit Numbers?

Answer»

I am looking for a simple Excel spreadsheet (no Marcos) than when You Enter past 3-digit Numbers can generate 5 new 3-digit numbers. Like for example 159 was drawn and use that NUMBER (159) to come up with 5 new (3-digit numbers). So it would be based on past number or a few past numbers. You can use formulas in the other five cells. By using the value typed into the original cell you can generate values for the other five cells.

Quote

So it would be based on past number or a few past numbers.

You could KEEP a history of past numbers EITHER on another worksheet or in hidden cells on the main worksheet. Keep in mind that past performance is no guarantee of future results. That is Great, but what are the formulas in the other 5 cells for the value typed in the original cell?I can't really give you any specific formulas, but I can show you the mechanics of setting this up:

Assume cell A1 is where the 3 digit number is entered. In cell D4 you could put the formula =(A1*3); in cell E7 you could put the formula =(A1^2); repeat, using other formulas in any other 3 cells.

As soon as the 3 digit number is entered in A1, the other cells will recalculate based on the A1 value. Of COURSE it will be your job to come up with formulas that guarantee all the results will be 3 digit numbers.

Good luck.

Just curious, but why no macros?
2017.

Solve : Writing Batch Files?

Answer»

I need some help in writing a batch file that would backup like *.JPG *.wmv *.jif FILES with a DATE stamp of either CURRENT date or a date entered by user to a flash drive. I am using XP.
kenTry in the DOS forum.

2018.

Solve : Java scripting Need help?

Answer»

im having to make a really interactive website that is user friendly (textbox, blogs, and bbs's) the program im using to create the website is Frontpage EXPRESS. it has a scripting feature that allows u to create JAVA scripts. any one have a few POINTERS?JAVASCRIPT for frontpage expresshttp://www.fluffbucket.com/fpe/javascript.htm

2019.

Solve : Where to begin programing?

Answer»

hello all. I've began to take an interest in creating programs but i don't know where to begin. i want to know how programing began and want to begin at the very roots of programing. ive READ some stuff like c++ , interpreters, and VISUAL basic but i dont know what all that is. I've read how to WRITE COMMANDS like print but i want to know why the word print and and how it works. i want to know everything there is know from the roots about programing. i also want to know stuff like batch files and all the other stuff. i want to know everyting about computers. does any one know where i can begin or stuff to read. Any one have any Tips for me?Read Visual Basic.net for beginners, or just google computer programming and CHOOSE the wikipedia result.here go to this website
http://www.justbasic.com/
this program i have is very usefully,its like VB execept not as complicated. it has support for commands with ur COM ports, u can also make bmp games with animation in it its a begginner program but it was a very good start. I started out on this an it helped me better undertand VB

2020.

Solve : VB code question maybe??

Answer»

umm IM not sure about this. i have tried looking for how to create these notify icons and i made one but how do i get it to show up? do i have to make a code for it or what?and also now that i think about it, i have another question...
I'm making an explorer to view my WEBSITE (basically testing stuffs still trying to figure out VB) and I have buttons on the side that say like, home, music, pics, videos, about, etc... i also have next to these a WEB browser, how do i make a code for these buttons that just change the URL of the browser?You haven't stated which VB you are using VB6 or VB.NET. i have VB express 2005...Make a name for the web browser tool:

WebBrowser1.Navigate(TextBox1.Text)

Where the web address is in the TextBox. You can use combo or buttons to send you to the page you need. Did you try the tutorials? That is one of the first routines listed!

As for the icons, what exactly are you doing?

TedTextboxes don't have a text property after version 6.0. it is a .Value property.wow lol this is an old topic...Not anymore QUOTE from: BC_Programmer on December 31, 2007, 07:54:34 PM

Textboxes don't have a text property after version 6.0. it is a .Value property.

Rubbish, I use VB.NET 2003 and VB.NET 2008 and both have a .text property!Quote
I use VB.NET 2003 and VB.NET 2008 and both have a .text property!

Ditto for VB.Net 2005

Even the IntelliSense shows a .text property but no .value property for a textbox.

Oops sorry- maybe I'm thinking of the first .NET Framework?

Or maybe I'm just confused...

I've only really created class libraries in .NET. Please forgive me :O
2021.

Solve : Help with Python?

Answer»

Hello everyone im begining to learn python as my first COMPUTER language but im haveing trouble starting the IDLE Python GUE but the python command line does. im think maybe i downloaded the wrong one . my computer is win xp home edition. if u know what i should dowload from the Python website PLEASE help. p.s if u know any good python tutorials let me know.I never had a problem with that.
I would suggest you UNINSTALL and REINSTALL again. try activestate Python. If you want to learn Python, the Python documentation site is the best resource you can have.

2022.

Solve : How the heck do I draw stuff in VB.NET??

Answer»

Alright I have Visual Studio 2005 professional.

I was about to start a new (well, I want to redesign one of my older games...) project in VB6, and then I figured that if I started it in VB .NET I'd have a reason to use Vb.NET (I had yet to do anything more than extremely basic tinkering).


I'll spare everybody from the laydown of my object heirarchy, but what I need is a graphics context form a picturebox. I cannot seem to find it. I'd expect something like PictureBox1.GetGraphics() like Java or just a Graphics Property.

can anybody point me in the right direction?

I know I can GET a Graphics Object by waiting for a Paint() even in the picturebox, but I'd prefer to set up double-buffering when the APP starts, rather then when the picturebox first paints.
Well, I solved my own problem. personally I think it is a bit kludgy-

What I did was initialize the backbuffer in the Paint Event of the picturebox, using a local static to track the fact that I have already initialized it. And in the Else clause of that If Block I Call the Render() Method of the Graphics context.


So I fixed my problem, but now I'm confused! In VB6 you could Pset, Line, etc whenever you desired, there was no requirement to do so only within the paint event. Is this a new restriction, or am I overlooking some other method (pardon the pun) of getting the Graphics Object?You're overlooking the simple method. What you need to do, is draw a picturebox or object box (or anythign for that matter but i use one of thos) in the background of where you want your picture. Then you ned to create a new pen using the command

Dim myPen as new Pen(Color.Red)
myPen.Width = 5

Of course, you can use any other colour and width.
Now you need a place to draw (here is my picturebox)

Dim g as Graphics = Picturebox.CreateGraphics

Then you can draw things! Here's a few examples.

g.DrawLine(myPen, 1, 1, 45, 65)

g.DrawBezier(myPen, 15, 15, 30, 30, 45, 30, 87, 20)

g.DrawEllipse(myPen, New Rectangle(33, 45, 40, 50))


Etc

There are many others.

For anything more advanced, feel free to post here or in

http://z15.invisionfree.com/ISURA_Solutions

Have a good day.Oh OK, so it was the "createGraphics" method that I was looking for.

I had a strong feeling I was missing something! I was looking for either a property named "Graphics" or canvas, or a method like GetGraphics.

what I am doing is re-writing a VB6 Game I wrote ages ago to VB .NET. It's a arkanoid clone. Right now I am just starting to lay out the object heirarchy. What I'm doing is implementing a "Normal" Block as the Base Class for extending/Creating new blocks. What I'll have is the rendering CODE that will loop through the blocks and draw them (at level set-up), by calling the Draw() method, which accepts a GraphicsBuffer object.

So I guess the NEXT time I get a chance I CAN add the backbuffer initialization code to Form_Load like I originally tried. I couldn't find anything in the object browser, but I must not have looked hard enough.


Thank you for the help!

2023.

Solve : Time.h?

Answer»

In c/c++ I'm trying to learn about time.h.
I can't find a GOOD tutorial on it so it's CONFUSING me.

does ANYONE have a tutorial to help me with this?
THANKS,
S_R_SThis MAY help:

Time.h

Good luck. Thanks!

2024.

Solve : Does anyone know VB.Net really good??

Answer»

I need help on VB.net and I need it fast. Does ANYONE KNOW VB.net really good and can go into a personal chat with me? Please. I know some VB.net and I can probably find what I don't know. Plus I've got a LOT of experience with C# dot NET and the languages are PRETTY similar. But I can't get into a personal chat with you. Any ASSISTANCE will be on this forum.Contact me via my forum, and I'll personal chat you through that.

2025.

Solve : Layer in VB.NET?

Answer»

I am trying to draw SOMETHING on a TAB control but it seems that if i draw a graph my DRAWING will be place behide the TAB. If i try to draw ANYTHING over controls it will be place behided.

Please helpRight CLICK on the tab, and then SELECT "send to back."

2026.

Solve : I need Help with VisualBasic.net?

Answer»

Can someone please help me with VisualBasic.net??? I am new to VB.net and I am having problems with a code. The question is I have two txtboxes and two btn. I need to get the info to transfer from box ONE to box two when I push the opposite btn. SUch as push btn 1 and the text in box one transfers to box two. push btn two and the text in box two transfers to box one. can anyone help? and if so can you be a tutor for me?Certainly. You MIGHT CONSIDER telling us what you want you want help for.

If you want a whole TEAM to help you, go to http://z15.invisionfree.com/ISURA_Solutions, they're very good, and ALSO new.

2027.

Solve : New to VB Express How do i work with Dll's?

Answer»

1. but how do i find out what usb port # its on?It won't be port 1, i'm not sure what that is, i was just using an example. I don't actually know, nor do I know how to find out... maybe someone ELSE knows how to find out?ok i change the number to many TIMES and still i get the same error message.Code: [Select]Imports LEGOVPBrickLib

Public Class Form1
Const MyPort As Integer = 1 'change this to your usb port

Private Sub SendBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SendBtn.Click
Static LegoThing As New LEGOVPBrickLib.VPBrick '*new* was needed
Try
LegoThing.Open(MyPort.ToString)
LegoThing.Download(SendTxtBox.Text)
Catch ex As Exception
MsgBox("Error: " & ex.Message, MsgBoxStyle.Critical, "An error has occured.")
End Try
End Sub
End Class
I tried this on my computer but I believe your dll needs a heck of a lot of code to interface with it as it was returning a COMException and an InnerException, which means I need to dissassemble the dll to know what to send to it, which takes a very LONG time and is incredibly difficult. I could try, but
1: without the mindstorms set I have no way of testing it and
2: it would take me at least 2 weeks, probably 3 to write the code.

Is there a manual that comes with your mindstorms set which tells you how it can work? Or a ReadMe that came with the dll? Anything at all that came that can give me a headstart?the help file that came with the dll is to LARGE can i send it to u by email?Feel free. I will PM you my email.I'm very sorry, but It just won't work, no matter what I do. Do you know anybody who has SUCCESSFULLY communicated with the set? You may have to ask them how its done.

I even tried and online "example" - it returned 57 errors.

Here is a link to a sample I found - its VB6, however

http://news.lugnet.com/robotics/?n=23464

Once again, I am very sorry.its ok thank you for trying.

2028.

Solve : help restore back up !!!?

Answer»

I am having trouble restoring a bkf file. I GOT a new hard drive and I am TRYING to restore the back up from my OLD hard drive. I used the windows back up program. But now when I try to restore it TELLS me it is UNRECOGNIZABLE and can not be used. HELP!

2029.

Solve : visual basic version?

Answer»

hi guys. i want to INSTALL visual basic. but i dont know if what version of VB is ideal to use?ALWAYS use the newest. Go to the microsoft website and download VB.net 2008 Express Edition.

http://www.microsoft.com/express/download/default.aspx

P.S. you always use the newest because if you keep using the old ones, they stop running on newer COMPUTERS... i learnt that the hard way...

Anyway, 2008 is a really good program, aside from taking forever to load help, its really good.

Yours,
BonesMy PC is 2 months old, and it runs VB 1.0 released in 1991, and also QBasic released in 1985 and GW-BASIC from 1981. I don't know what you mean by "if you keep using the old ones, they stop running on newer computers..."
the programs you make stop running on new computers, sorry. I MADE a couple of programs in QBASIC the other day, transferred them to a new computer and they didn't work (which I expected).

I translated the program into VS2003, compiled it, and sent it across. It worked, but not how it worked on mine.

The programs themselves run on the CREATORS computer, but not others.But that's due to some quirk of your computer and the other one. It's not a general rule that older software "stops working" on later computers.

2030.

Solve : VS 2005 datagrind in web page?

Answer»

I have a web page with a data grind and a search button with a TEXT AREA, once i PASTE some username in the text box and hint search the grind gets populated with the data from DB.

NB: I want to update a column from the data that i get back once i search.
Its a web page and the connection to the DB is working fine.

Please advice and if more info needed i'll do so.

I will be back tommorow since its time to knock of now...

PS MEWhat is your question?The question is, I want to update a field.I couldn't find a reference to a data grind in the VS 2005 documentation. Are you referring to a data grid?

You didn't mention which VS language you're using but this link to a VB solution may help.

http://www.codeproject.com/KB/webforms/SetEntireDataGridColumnEd.aspx

Good luck. Hi Sidewinder

I'm using VS C# or .NET but C# is the one i want to use. Thanks for the link it has loads of good info.
Ya man its the data grid but i cant afford to make mistakes since i'm running against live database.

Thanks alot!!!!

2031.

Solve : how i can make a network conection?

Answer»

:)how i can MAKE a network conectionyou're going to have to explain more, Quote from: iskandar.zulkarnain91 on February 12, 2008, 11:39:46 PM

:)how i can make a network conection
Connect to a network...

If you WANT more SPECIFIC HELP you will need to tell us more about your situation.

2032.

Solve : Java - JTextPane & MS-Word?

Answer» HI all,
How can I load the content of a word document file into a JTextPane. How to USE Document, DefaultStyledDocument, ETC for this PURPOSE?
Thanks
doLoadCommand()
2033.

Solve : Learning to code (Python)?

Answer»

Hi guys,

I'm looking to LEARN how to code.

I want to start with PYTHON, and then move onto C++ (eventually).

Any handy pointers on learning code, and any good TUTORIALS on the above two?

ALSO, know of any good books?

Cheers,

Sidyou want to learn Python, so go to the Python DOCUMENTATION site.. learn the tutorial especially.

2034.

Solve : Creating an automated documentation tree?

Answer»

Hey.

I've been asked to create a program that will automate our documentation of projects that our company CREATES. However, I've scoured the WEB and several help books and I can't seem to find a way to make this work.

The program has to search our shared drive for folders with the word "FRED" in them (an example would be "FRED 4432"). Then, it has to take these folders and place them on a website where people can look at the FRED number (ie 4432) and the description of the file (both the FRED number and description have to appear AUTOMATICALLY on the page) and be able to find their projects. They should also be able to search for their projects with a search box.

The need for a search item is because the company hasn't been very organized with their projects. The projects are in many different places on the shared drive, and not all of them even have 'fred' in their folder name (some say request instead).

The program doesn't have to be in any SPECIFIC language, and I really haven't been given any specifics on the coding itself. Any help would be appreciated, so even if you can just point me in the right direction, I'll be grateful!

Thanks,
Coryhave you got any kind of programming experience? if yes, state what you know.I know HTML, but only have basic knowledge of visual basic. I'm pretty good at working through anything, though, and willing to try whatever you throw at me.

Right now, I have my project set up so that a dropdown folder contains the locations of the documents (I have a link to each folder), but I need a way to get each project to appear in an orderly fashion on the page.

2035.

Solve : C++ pointers?

Answer»

I'm having a hard time comprehending POINTERS..
can someone TRY to EXPLAIN it simply?HTTP://en.wikipedia.org/wiki/Pointer

2036.

Solve : Cellphone/ringtone help??

Answer»

This is not really about computers but more towards programming...

I have a cellphone (Nokia 6275i) and I want to DOWNLOAD RINGTONES onto it. But the problem is, these ringtones won't work. From another person I know, they said my company protected my phone with DRM so I can only use ringtones that I download from my server provider's website (meaning, I have to pay to use songs as ringtones). Is there anyway I can GET around this? The songs I am trying to use as a ringtone I already own on a PURCHASED cd...According to Wikipedia you can't configure a custom ring tone on this model. Do you really want to hack the phone with the RISK of turning it into a brick?

Sorta yea lol I would back up all the files or software on my phone, or if not i think it would be a nice project to try

2037.

Solve : Merging Tab Delimited Data to Excel with VB Script or Macro?

Answer»

Hello,

Its been years since I made an Excel Macro and I am thinking that VB Script is the better way to go, but I was wondering if there was an easy method of copying 3 columns of tab delimited data from a raw ascii text file and import it into an excel document at location A1 thru A14, B1 thru 14, and C1 thru C14, all 3 columns populated A,B, C from 1 through 14 with data of which I have formulas on the Excel page that pick up the 3 VALUES per row of 14 lines in the text file.

Can someone please type up a quick VB Script that could do this so I can make this work and start learning vb script. I know C++, Basic, Java Script, and other LANGUAGES, but unfortunately I never took VB and now is the time when it WOULD be very helpful to have taken it, and its never too late to learn. So I am going to get my feet wet with VB with this script hopefully.

Thanks,

DaveThis may help:

Code: [Select]Const ForReading = 1

Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("ascii.txt", ForReading)

Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open("Book1.xls")
Set xlSheet = xlBook.Worksheets("Sheet1")
xlSheet.Activate

For row = 1 To 14
strIn = f.ReadLine
arrData = Split(strIn, vbTab, -1)
xlApp.Cells(row, 1) = arrData(0)
xlApp.Cells(row, 2) = arrData(1)
xlApp.Cells(row, 3) = arrData(2)
Next

f.Close
xlBook.SaveAs("Book1.xls")
xlApp.Quit

Replace ascii.txt, book1.xls, and sheet1 with valid values. This script has not been tested and contains no error checking whatsoever. Thanks Sidewinder... I'll give this a try and see if it works.

DaveHello Sidewinder ...

well I get this error message when EXECUTING the VB Script. Yet, my data file is named ascii.txt and I tried this without a Book1.xls present and also with a Book1.xls in case it needed the Excel document to exist in order to populate with data. But I keep getting the same error message with and without the Book1.xls present in the same folder as the VB Script and the ascii.txt file named as such to match up with the VB Script that you posted.

I am using Excel 2000 on my system if that helps clarify this possibly if a handler issue.

The error message is
------------------------------------------------
Windows Script Host [X]

Script: c:\vbs\test.vbs
Line: 4
Char: 1
Error: File not found
Code: 800A0035
Source: Microsoft VBScript runtime error
-------------------------------------------------
[ OK ]

With the text file with the tab delimited data named ascii.txt it should be fine, yet its complaining about LINE 4, where this operation is pointing???


Const ForReading = 1

Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("ascii.txt", ForReading)

Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open("Book1.xls")
Set xlSheet = xlBook.Worksheets("Sheet1")
xlSheet.Activate

For row = 1 To 14
strIn = f.ReadLine
arrData = Split(strIn, vbTab, -1)
xlApp.Cells(row, 1) = arrData(0)
xlApp.Cells(row, 2) = arrData(1)
xlApp.Cells(row, 3) = arrData(2)
Next

f.Close
xlBook.SaveAs("Book1.xls")
xlApp.Quit

Thanks for taking the time to check this out and point out what I might be doing wrong or an operand issue with the initial code.

DaveI suspect that the script can't find Book1.xls. I may have misinterpreted your post Quote

all 3 columns populated A,B, C from 1 through 14 with data of which I have formulas on the Excel page that pick up the 3 values per row of 14 lines in the text file.
I guessed that the workbook existed with the formulas.

I didn't use any path names for the files, so the script expected ascii.txt, the script, and Book1.xls to be in the same directory. When I said the script wasn't tested, I meant with real data, the script runs without a syntax error....a logic error is another matter.

I'm using Excel 2002, but I doubt it's a great leap forward from Excel 2000.

Made a few changes to the script, mainly so you can see what's going on in Excel. I strongly urge you to use paths, especially on the SaveAs. I had a helluva time finding the saved workbook. (hint: it was buried in my user directory)

Code: [Select]Const ForReading = 1

Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("ascii.txt", ForReading)

Set xlApp = CreateObject("Excel.Application")
xlApp.DisplayAlerts = False
xlApp.Visible = True

Set xlBook = xlApp.Workbooks.Open("Book1.xls")
Set xlSheet = xlBook.Worksheets(1)
xlSheet.Activate

For row = 1 To 14
strIn = f.ReadLine
arrData = Split(strIn, vbTab, -1)
xlApp.Cells(row, 1) = arrData(0)
xlApp.Cells(row, 2) = arrData(1)
xlApp.Cells(row, 3) = arrData(2)
Next

f.Close
xlBook.SaveAs("Book1.xls") 'use a path
xlBook.Close
xlApp.Quit
I have a similar issue as the OP. I need to import a large .txt file into Excel. The data set in the .txt file is delimited by ":". In any given .txt file, there could be up to 70000 individual numbers separated by colons.

Excel attempts to import this data set into a single row, thus exceeding the maximum of number of columns that can be created in Excel. What I would like to do is process the data into Excel via a VB script, similar to the OP. I need the data to populate into a single column, thus filling vertical down the column.

Can anyone help? Thanks!Please don't hijack other threads. Many times posts get lost and don't receive the attention they deserve.

I'm having a hard time visualizing the input file. Is there a single line with 70000 characters occasionally delimited by a colon? If there are multiple lines, does each line end at the delimiter, or does the delimited data wrap lines?

Perhaps you could show the first two or three lines of data.

Sorry for the hijack

Here are a couple of lines of data

-3:-3:-3:-3:-2:-2:-2:-2:-2:-2:-1:-1:-1:-1:-1:0:0:0:0:1:1:1:1:1:1:2:2:2:2:2:3:3:3:3:4:4:5:5:5:6:6:6:7:
7:7:7:8:8:8:8:9:9:10:10:11:11:11:11:12:12:13:13:13:14:14:15:15:15:16:16:17:17:18:18:18:19:19:
19:20:21:21:22:22:23:24:24:25:25:25:26:26:27:27:27:28:29:30:30:31:31:32:33:33:34:34:35:35:
36:36:37:38:38:39:40:40:41:41:42:43:43:44:45:46:47:47:47:48:49:50:50:51:52:53:54:55:55:56:57:
58:59:60:60:

I don't think that line breaks actually exist in this data stream....it's just a continuous row of numbers separates by colons.

I appreciate the help!I got some strange results on some rows, but it may just be the way I cut and pasted your data.

Code: [Select]Const ForReading = 1

Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("ascii.txt", ForReading)

Set xlApp = CreateObject("Excel.Application")
xlApp.DisplayAlerts = False

Set xlBook = xlApp.Workbooks.Add()
Set xlSheet = xlBook.Worksheets(1)
xlSheet.Activate

row = 0
strIn = f.ReadAll
arrData = Split(strIn, ":", -1)
For x = 0 To UBound(arrData)
row = row + 1
xlApp.Cells(row, 1) = arrData(x)
Next

f.Close
xlApp.Visible = True

I didn't write any save code, but you can save the spreadsheet through normal means when it appears.

Good luck.
That code works great, with one slight problem. I think that I have too many data values to import into a single column in Excel 2003. If I cut the data stream in half, the code imports with no problem. However, if I try to import the entire data file, the code stops with errors.

Is there a way for the code to open a new "sheet" once the maximum number of rows is obtained? If not, I make this work.

I really appreciate the time and code!

I found that Excel 2003 has a maximum of 65,536 rows.

Code: [Select]Const ForReading = 1

Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("ascii.txt", ForReading)

Set xlApp = CreateObject("Excel.Application")
xlApp.DisplayAlerts = False

Set xlBook = xlApp.Workbooks.Add()

maxRows = 65535
row = 0
strIn = f.ReadAll
arrData = Split(strIn, ":", -1)
For x = 0 To UBound(arrData)
If row > maxRows Then
row = 0
Set xlSheet = xlBook.Sheets.Add
xlSheet.Activate
End If
row = row + 1
xlApp.Cells(row, 1) = arrData(x)
Next

f.Close
xlApp.Visible = True

I used maxRows - 1 in the script. You can play around with this number depending how many entries you need per worksheet.

Good luck. Perfect! Thanks for all of the help!

2038.

Solve : Restore Backup Files??

Answer»

I have a Toshiba Qosmio that is starting to be naughty. My Trend Antivirus keeps sending me messages about the LATEST installment not working, I cannot open My Documents, though if I access SIMILAR files on the other drive it works. The sound is garbled, and my Media Center dropped recording a program last night.

I have used my Virus Scan, Ewido, and Crap Cleaner, with no results.

I feel tempted to wipe the WHOLE thing and reformat, which I did once quite a while ago, but it's so time consuming to re-install programs, etc. My question is, what does the Windows backup file provide? I have a 'backup' file I made a month ago on my external hard drive, but don't know to what EXTENT it will put the system back to how it should be.

any advice would be welcome. THANKS

2039.

Solve : javascript & C++?

Answer»

How to CALL a module made in c++ from JAVASCRIPT .. For eg suppose I click on a button made of javascript a PROGRAM written in c++ should be called ... PLEASE HELP ..

2040.

Solve : HTML in IE & FF help?

Answer»

Hello

Can someone tell me how I can get my MySpace music player to be displayed in IE & Firefox please?

Here's the code I'm USING:





http://www.my.mp3" />
http://www.my.mp3" />
http://www.my.mp3" />






I think it's to do with the application x-mplayer2 & Firefox as I have a similar flash object which is displayed fine in both browsers.

This is the code I'm using for the object that WORKS in both browsers:

http://www.myvideo.swf">


http://www.myvideo.swf" />




I read somewhere that I NEED to install npdsplay.dll & npwmsdrm.dll into my Firefox plugin folder in order to get the x-mplayer2 to work, but this didn't help - I still see nothing.

I've also read about the 'pluginspage' param, if anyone knows the plugin URL for the x-mplayer2 that may help.

Thanks guysI've also tried to download the Mozilla WMP plugin from this site:

http://kb.mozillazine.org/Windows_Media_Player#Installing_the_new_plugin

It didn't work. If someone with Firefox can test to see if my page is displaying the WMP for them I would be grateful:

http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=102379283

Thanks...

2041.

Solve : how do i make a batch file so it will do something when you press a certain key??

Answer»

I am fairly new at batch and am trying to make a program. i want it so that it will take KEYBOARD commands. I know the pause command, but say I wanted to make it so that i had a hub for all the drives and i pressed F for the F Drive, Q for the Q drive, and so on. how do i do this?

I have a list of batch commands that SAYS the command to ALLOW keyboard input is choose, but i don't know how to use it. If anyone knows a more detailed list that tells all the batch commands and how to use them could you please post the url?The availability of commands depends on the Operating SYSTEM being used. You didn't mention yours - here are the XP commands.

2042.

Solve : regarding make file?

Answer» CC = gcc

CFLAGS = -g -Wall



OS=UNIX



ifeq ($(OS),UNIX)

TRANSCRIBE_DIR = './transcribe/'

SEGMENT_DIR = './segment/'

INTERVALS_DIR = './intervals/'

QUANTIZE_DIR = './quantize/'

SEARCH_DIR = './search/'

COMMON_DIR = './common/'

MRR_DIR = './mrranalysis/'

DBGEN_DIR = './dbgen/'

SYNTH_DIR = './synth/'

BIN = './bin/'

EXE =

else

TRANSCRIBE_DIR = '.\transcribe\'

SEGMENT_DIR = '.\segment\'

INTERVALS_DIR = '.\intervals\'

QUANTIZE_DIR = '.\quantize\'

SEARCH_DIR = '.\search\'

COMMON_DIR = '.\common\'

MRR_DIR = '.\mrranalysis\'

DBGEN_DIR = '.\dbgen\'

SYNTH_DIR = '.\synth\'

BIN = '.\bin\'

EXE = '.exe'

endif



################################# LIBRARIES #########################################

# Transcription Module LIBRARY

#com :

$(CC) $(CFLAGS) -c $(COMMON_DIR)common.c -o $(BIN)common.o



libtra :

$(CC) $(CFLAGS) -I $(COMMON_DIR) -c $(TRANSCRIBE_DIR)libtra.c -o $(BIN)libtra.o



# SEGMENTATION Module Library

libseg :

$(CC) $(CFLAGS) -I $(COMMON_DIR) -c $(SEGMENT_DIR)libseg.c -o $(BIN)libseg.o



# Intervals Module Library

libint :

$(CC) $(CFLAGS) -I $(COMMON_DIR) -c $(INTERVALS_DIR)libint.c -o $(BIN)libint.o



# Quantize Module Library

libquant :

$(CC) $(CFLAGS) -I $(COMMON_DIR) -c $(QUANTIZE_DIR)libquant.c -o $(BIN)libquant.o





# Search Module Library

libsearch :

$(CC) $(CFLAGS) -I $(COMMON_DIR) -c $(SEARCH_DIR)libsearch.c -o $(BIN)libsearch.o



################################ PROGRAMS ######################################

# type make (module name) from the (base dir).

# The executables are copied to (base dir)/bin/

# The output files are placed in (base dir)/out/



#Builind them all at once

single: tra seg int qua sea



# Transcription Module Executable

tra : libtra com

$(CC) $(CFLAGS) -I $(COMMON_DIR) $(TRANSCRIBE_DIR)transcribe.c $(BIN)libtra.o $(BIN)common.o -lm -o $(BIN)transcribe$(EXE)



# Segmentation Module Executable

seg : libseg com

$(CC) $(CFLAGS) -I $(COMMON_DIR) $(SEGMENT_DIR)segment.c $(BIN)libseg.o $(BIN)common.o -lm -o $(BIN)segment$(EXE)



# Intervals Module Executable

int : libint com

$(CC) $(CFLAGS) -I $(COMMON_DIR) $(INTERVALS_DIR)intervals.c $(BIN)libint.o $(BIN)common.o -lm -o $(BIN)intervals$(EXE)



# Quantize Module Executables

qua : libquant com

$(CC) $(CFLAGS) -I $(COMMON_DIR) $(QUANTIZE_DIR)quantizequ.c $(BIN)libquant.o $(BIN)common.o -lm -o $(BIN)quantizequ$(EXE)

$(CC) $(CFLAGS) -I $(COMMON_DIR) $(QUANTIZE_DIR)quantizedb.c $(BIN)libquant.o $(BIN)common.o -lm -o $(BIN)quantizedb$(EXE)



# Search Module Executables

sea : libsearch com

$(CC) $(CFLAGS) -I $(COMMON_DIR) $(SEARCH_DIR)search.c $(BIN)libsearch.o $(BIN)common.o -lm -o $(BIN)search$(EXE)

$(CC) $(CFLAGS) -I $(COMMON_DIR) $(SEARCH_DIR)sort.c $(BIN)common.o -o $(BIN)sort$(EXE)

$(CC) $(CFLAGS) -I $(COMMON_DIR) $(SEARCH_DIR)genhtml.c $(BIN)common.o -o $(BIN)genhtml$(EXE)



# MRR experimentation module executable

mrr : com

$(CC) $(CFLAGS) -I $(COMMON_DIR) $(MRR_DIR)findrank.c -o $(BIN)findrank$(EXE)

$(CC) $(CFLAGS) -I $(COMMON_DIR) $(MRR_DIR)tansenbatch.c -o $(BIN)tansenbatch$(EXE)

$(CC) $(CFLAGS) -I $(COMMON_DIR) $(MRR_DIR)findmrr.c -o $(BIN)findmrr$(EXE)



#database generation

db : com

$(CC) $(CFLAGS) -I $(COMMON_DIR) -I $(TRANSCRIBE_DIR) -I $(SEGMENT_DIR) -I $(INTERVALS_DIR) $(DBGEN_DIR)database.c $(BIN)common.o $(BIN)libtra.o $(BIN)libseg.o $(BIN)libint.o -lm -o $(BIN)database$(EXE)



#synthesis for debugging

syn : com

$(CC) $(CFLAGS) -I $(COMMON_DIR) $(SYNTH_DIR)note2tpe.c $(BIN)common.o -lm -o $(BIN)note2tpe$(EXE)

$(CC) $(CFLAGS) $(SYNTH_DIR)synth.c -lm -o $(BIN)synth$(EXE)

##########################################################################

What may be the PROBLEM in above make file.?
I do write make and press the enter. it comes as:
gcc -g -Wall -I './common/' -c './common/'common.c -o './bin/'common.o
2043.

Solve : how can i move whole directories in batch??

Answer»

I am trying to make a program that will TAKE the F DRIVE and copy it all to the Q:\batch-files\batch\all. How do i do this?From a COMMAND PROMPT type: XCOPY /?

XCOPY comes with an alphabet SOUP of switches.

Good luck.

2044.

Solve : help me serial port my problem?

Answer»

Can somebody help? Really need help.
I got this sample from internet but there some problem ..
1. when that code run and i`m choose my comport and received data from serial port that display the data like that
this is my user interface--------> http://img292.imageshack.us/img292/8876/uixv7.jpg
and received data display like this-------> http://img214.imageshack.us/img214/6304/errorfw1.jpg

Really need help to show the send data like the recived data
note :::: my recived data like -----> (466798 kg )

...thanks ..


Code: ( vb.net 2005)
Private Sub Receiver(ByVal sender As Object, ByVal e As SerialDataReceivedEventArgs) Handles COMPort.DataReceived
' Note this subroutine is executed on the serial port thread - not the UI thread.
Dim RXByte, Nibble As Byte
Dim RXArray(2047) As CHAR
Dim I As Integer = 0
Do
RXByte = COMPort.ReadByte
Nibble = (RXByte >> 4) + 48 ' Convert received byte to Hex

If Nibble > 57 Then
Nibble = Nibble + 7
End If
RXArray(I) = Chr(Nibble)
I = I + 1
Nibble = (RXByte And 15) + 48
If Nibble > 57 Then
Nibble = Nibble + 7
End If
RXArray(I) = Chr(Nibble)
I = I + 1
RXArray(I) = " "
I = I + 1
SpaceCount = (SpaceCount + 1) And 31 ' Insert spaces and CRLF for better readability
If SpaceCount = 0 Then ' Insert CRLF after 32 numbers
RXArray(I) = Chr(13) ' CR
I = I + 1
RXArray(I) = Chr(10) ' LF
I = I + 1
Else
If (SpaceCount And 3) = 0 Then ' Insert two extra spaces for each 4 numbers
RXArray(I) = " "
I = I + 1
RXArray(I) = " "
I = I + 1
End If
End If
LOOP Until (COMPort.BytesToRead = 0)
Dim RxString As New String(RXArray, 0, I) ' Convert the first part of the Char Array to a String
' Put a message with a delegate, which POINTS to the display routine and holds the RxString,
' on the message QUEUE and return immediately.
Me.BeginInvoke(New StringSubPointer(AddressOf Display), RxString)
End Sub

' Text display routine, which appends the received string to any text in the Received TextBox.

Private Sub Display(ByVal Buffer As String)
Received.AppendText (Buffer)
End Sub

' Transmitter subroutine.

Private Sub Transmitter(ByVal sender As Object, ByVal e As EventArgs) Handles SendButton.Click
Received.AppendText ("TX" & vbCrLf) ' Switch to a new line after every transmission
SpaceCount = 0
Dim TextString As String
Dim TXArray(2047) As Byte
Dim I As Integer
Dim J As Integer = 0
Dim Ascii As Boolean = False
Dim Quote As Boolean = False
Dim Temp As Boolean
Dim Second As Boolean = False
Dim TXByte As Byte = 0
Dim CharByte As Byte
If COMPort.IsOpen Then
TextString = Transmitted.Text
For I = 0 To TextString.Length - 1
CharByte = Asc(TextString.Chars(I))
If CharByte = 34 Then ' If " Then
Temp = Ascii
Ascii = Ascii Or Quote
Quote = Not (Temp And Quote)
Else
Ascii = Ascii Xor Quote
Quote = False
End If
If Not Quote Then
If Ascii Then
TXArray(J) = CharByte
J = J + 1
Else
If (CharByte <> 32) And (CharByte <> 10) And (CharByte <> 13) Then ' Skip spaces, LF and CR
CharByte = (CharByte - 48) And 31 ' And 31 makes it case insensitive
If CharByte > 16 Then
CharByte = CharByte - 7
End If
If Second Then
TXArray(J) = TXByte + CharByte
Second = False
J = J + 1
Else
TXByte = CharByte << 4
Second = True
End If
End If
End If
End If
Next
Try
COMPort.Write(TXArray, 0, J)
Catch ex As Exception
MsgBox (ex.Message & " CHECK CTS signal or set Flow Control to None.")
End Try
Else
thanks again..
MsgBox ("COM port is closed. Please select a COM port")
End If
End Sub

2045.

Solve : Starting on HTML?

Answer»

I have RECENTLY started my Javascript class and we are going over the HTML and XHTML.

Now, my book says to do some things and I did the assignment in notepad but YET when I go to open it with IE, it looks just like the notepad version when I know it shouldnt.

I even tried saving it as an HTML document.
What AM I doing WRONG??

heres one of the assignments that is "finished"

<html>
<html xmins="http://www.w3.org/1999/xhtml">
<head>
<title>Azerbaijan</title>
<META http-equiv="content-type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<center><font face="arial" color="navy">
<h1>Azerbaijan</h1>
<p><strong>Offical name</strong>: Republic of Azerbaijan

<strong>Ethnic groups</strong>: Azeri 90%, Dagestani 3%, Russian 3%, Armenian 2%

<strong>Principal languages</strong>: Azeri (offical), Russian, Armenian
</p>
</font></center>
</body>
</html>
when you saved it in notepad, did you remember to put .html at the end of the file name?when you save it remember to put a .html after the name and save it under all files...

i copied it and saved it as an html file and it worked

2046.

Solve : run Turbo C in prototype?

Answer»

how can i run programming using Turbo C and connecting my program to a PROTOTYPE?

what device can be use to transfer the program in my design?You've written something in Turbo C correct?
What do you NEED to transfer it to?
yup, i try to run my program into the prototype. when i run the program in TC also with my prototype with the same output.What is this prototype?Quote from: Deerpark on January 25, 2008, 09:52:47 AM

What is this prototype?
what is the meaning of the prototype? Please EXPLAIN it in detail.
2047.

Solve : BAT Files and USB Ports. is it possible??

Answer»

is there a way to program bat files to work with USB ports?
such as controling an outside device, a Lego USB Tower. i would like to try and control my lego mindstorms robot from my comp using a Batch program. is it even possible?Quote from: macdad- on January 19, 2008, 07:53:04 AM

...
such as controling an outside device, ...


The above quoted part reminded me of something I read online.
It is not batch file related, nor USB. If those are of key importance, then the link I have in mind is not going to be for you.

If controlling devices is the key thing though, you might like to visit and read:
http://www.hardwaresecrets.com/article/233

It is interesting.


There are 7 pages. It starts out with a simple example. Just LEDs.
By the 6th page or so, it shows you how to build and interface to control just about anything.

that page is really interesting. i was watching on the discovery channel last christmas. about christmas lights and this guy in florida had a comp controled christmas lights. the page u sent me to actually told me how to do that.

Thanks!!!Hello macdad,
to start off (if you have not ALREADY) install VB Express or something, then you can easily write input/output procedures.

Beyond the LEDs you can play with, you can hookup Stepper Motors that can be harvested from CD drives.

There is more fun than just playing with a LPT port. You can hookup an Analog Joystick (BEST a X &AMP; Y , 4 button FligthMaster with a Hood Switch) to the Gaming port, and there is where the fun starts.
Now you can control the Stepper. All you need is a PCI Sound card.

I intercepted the X and Y and Hood Switch and hooked up an Infrared Detector and displayed the received results on the screen. If it works properly it can receive Radio Speaker SIGNALS or display your Heart Beat from your finger via a Laser beam.

Caution:
The PCI cards this way are easy to fry!!
However a used one + Software you can buy for $10.
Also PowerSupplies are easily burned out if the Stepper Transistors are not running in the proper sequence.

With a bit of searching you can find all the Info on the Internet.

Let me know how you are making out.

Regards.

Quote from: macdad- on January 21, 2008, 06:06:16 PM
that page is really interesting. i was watching on the discovery channel last christmas. about christmas lights and this guy in florida had a comp controled christmas lights. the page u sent me to actually told me how to do that.

Thanks!!!

You're very welcome.

I'm glad you took time to read it, and that you found it interesting.
I did - I suppose that is why I had it bookmarked. I'm glad I did that too, now.

Thanks for posting back too.


It sounds like it got you to dreaming and thinking. That is a Good Thing.

And, it appears that alexK is into that sort of thing too. If you two partner up, be nice to me when you take over the world, ok? Quote from: WillyW on January 19, 2008, 09:54:14 AM
Quote from: macdad- on January 19, 2008, 07:53:04 AM
...
such as controling an outside device, ...

The above quoted part reminded me of something I read online.
It is not batch file related, nor USB. If those are of key importance, then the link I have in mind is not going to be for you.

If controlling devices is the key thing though, you might like to visit and read:
http://www.hardwaresecrets.com/article/233

It is interesting.

There are 7 pages. It starts out with a simple example. Just LEDs.
By the 6th page or so, it shows you how to build and interface to control just about anything.

That's a pretty cool IDEA..... All kinds of ideas are popping into my head after reading that.
Quote from: alexK on January 21, 2008, 08:01:17 PM
You can hookup an Analog Joystick (best a X & Y , 4 button FligthMaster with a Hood Switch) to the Gaming port, and there is where the fun starts.

would a PS2 controller work. i have the conecter cable and the controller.macdad- ,

I started the experiments with an old Joystick that I found in the basement. That one is an Analog with 15 pins. An USB one appears to be Digital, but I am not sure.
Searching on the internet I only found projects using the 15 Pin ones. I don't know if all 15 Pin joysticks are Analog. Maybe somebody out there may be able to fill in on that one.
To interface the data from the Gaming or LPT Port in VB Express requires DLLs (e.g. InOutput or InOutput 32) that can be downloaded. (VB Express does not support that Interface).
To run those projects requires some extensive programming and research on the Internet. The U.K. has quite some selection.
thanks for the tip
2048.

Solve : Can I use a batch file to open a file with a certain extension??

Answer»

I have a batch file I have set up so when i right click on a folder i have the choice to run it and open a file inside that's always got the same name and extension. This one works fine.

Code: [Select]if EXIST JOB.TWJ start JOB.TWJ
exit
Now for my problem. I would like to be able to do the same thing with a file that does not have the same name in each folder but always has the extension .wbl and is the only file with that ext in that folder.

This is what i tried. Which didn't work but i don't know enough about coding to understand why.

Code: [Select]if exist "*.WBL" start "*.WBL"
exit
I don't have much experience with batch files but i did search Google and looked on any site I thought might have an answer, but I couldn't find anything relating to opening a file by checking its extension.

Thanks for helping.

TopDawgPlease do not double post; it only confuses the natives.

The if statement does not accept wildcards in this context. Which file do you want to start?...the processor doesn't know either.

It's possible to iterate all the files with a wbl extension and start each individually but that can get really messy with all those WINDOWS popping open.

By the way, what program is associated with wbl extensions?

Sorry about the double topic post. The other one was in the wrong place but its deleted now.

The .wbl extension is for a program at work to design walls.

Their will only ever be one file with the .wbl extension in a folder so multiple windows opening shouldn't be a problem.

This is the file structure I'm working with in case in helps.

--JOBS
----JOB1
------WALL
------TRUSS
----JOB2
------WALL
------TRUSS
----JOB3
ECT.


I added a right click entry through the registry so I can click on the truss folder and chose open job and it will open job.twj. That works fine. I want to be able to right click on the wall folder and open .wbl. The context menu is already set up I just don't know how the code that second batch file.

Thanks I suspect the problems lies with SELECTING a folder and expecting Windows to grab a handle to a file within the folder. I don't think that will happen.

Code: [Select]@echo off
for /f "tokens=* delims=" %%x in ('dir /b selectedfolder\*.wbl') do start "%%x"

I'm curious, how do you capture the name of the folder you select?

This is what the registry entry I use to make the right click menu is.

Code: [Select][HKEY_CLASSES_ROOT\Folder\shell\Access_Truss_Job\command]
@="\"C:\\Documents and Settings\\TrussXXXX\\My Documents\\Shortcuts\\@Open Truss Job.bat\" \"%1\""
That effectively runs the batch file in the folder that I right click on no matter where it is.

I tried the code you provided but it doesnt seem to work. I may be doing something wrong though.Still not sure how this all goes together. It seems %1 (the clicked file) gets passed as a parameter to Open Truss Job.bat. What's in Open Truss Job.bat?

I was thinking along the lines of this article (scroll down to Open the Command Prompt from the Right-Click Menu) where you could get a handle on the folder, iterate thru the contents and start each wbl file. There is only one wbl file per directory anyway. Are wbl files even executable or is there a program processing them using the file name as a parameter?

If all you need to do is pass the file name of the wbl file, setting up a file association has gotta be easier than hacking the registry. The downside of an association would be you have to drill down to the file level.

The reason im trying to do this is so I can have the folder tree open for the job im doing and right click on the truss and wall folder to open the different parts of the job without having to go all the way into each folder then back out and go to the next folder.

The open truss job.bat has this code in it.

Code: [Select]if exist JOB.TWJ start JOB.TWJ
exit
I have the registry and right click menu set up, so all I need now is to get the batch file to start the wbl file.

The .wbl files are already associated to the program that they work with, so if you were to just double click on the .wbl file it will open in the program. Also in cmd I can cd to the folder the file is in and input "start FileName.wbl" and it works so I just need to get the batch file to run all files with the .wbl extension.

Thanks for you help and sorry if that still isnt clear.The article seemed to say that the %L variable held the clicked folder name. How or why this CAME to be I cannot answer, but if true it should be easy to set up the batch code.

In the registry entry (based on your code) something like this should work:

Code: [Select]@="\"C:\\Documents and Settings\\TrussXXXX\\My Documents\\Shortcuts\\@Open WBL Job.bat\" \"%L\""

The contents of Open WBL Job.bat would be:

Code: [Select]@echo off
for /f "tokens=* delims=" %%x in ('dir /b %1\*.wbl') do start "%1\%%x"

Your first example shows you can reference the clicked folder name. The WBL example works the same way except it FINDS the contents of the clicked folder before launching anything.

Hope this helps.

Edit: The %L is a system variable that holds the name of the file that you are right-clicking on.*

* Source

Okay I changed the reg entry from %1 to %L. This is the output I get when I try to run it with the new code you provided.

W:\NEW TREE FORMAT\JOBS\772822\772822P>for /F "tokens=* delims=" %x in ('dir /b"W:\NEW TREE FORMAT\JOBS\772822\772822P"\*.wbl') do start ""W:\NEW TREE FORMAT\JOBS\772822\772822P"\%x"

W:\NEW TREE FORMAT\JOBS\772822\772822P>start ""W:\NEW TREE FORMAT\JOBS\772822\772822P"\772822-GH278-WAINWRIGHT-E-RS-FUL-CUSTOM.WBL"

W:\NEW TREE FORMAT\JOBS\772822\772822P>pause
Press any key to continue . . .

I looks like that should work but it doesn't.
Any more ideas? It looks to me like the positions of the quotes when it tries to do the start command might be wrong, but I'm the one needing help so I really have no idea.

Sorry for the trouble but I appreciate your help SidewinderI guess the quotes make sense, around a file name they can be helpful, around a folder name they're just pesky little dit marks. Cheesh!

I'm guessing it's just a quick fix. Forgetting about the quotes, is the path correct?

Code: [Select]@echo off
for /f "tokens=* delims=" %%x in ('dir /b "%~1\*.wbl"') do start "%~1\%%x"



Geez I hate quotes and you can quote me on that.
The path is correct and the quotes appear to be in the right places now.
Here is the new output.
The title of the first window is

C:\WINDOWS\system32\cmd.exe

and the contents are

W:\NEW TREE FORMAT\JOBS\772822\772822P>for /F "tokens=* delims=" %x in ('dir /b "W:\NEW TREE FORMAT\JOBS\772822\772822P\*.wbl"') do start "W:\NEW TREE FORMAT\JOBS\772822\772822P\%x"

W:\NEW TREE FORMAT\JOBS\772822\772822P>start "W:\NEW TREE FORMAT\JOBS\772822\772822P\772822-GH278-WAINWRIGHT-E-RS-FUL-CUSTOM.WBL"

W:\NEW TREE FORMAT\JOBS\772822\772822P>pause
Press any key to continue . . .

Then up pops another window with this title

W:\NEW TREE FORMAT\JOBS\772822\772822P\772822-GH278-WAINWRIGHT-E-RS-FUL-CUSTOM.WBL

and this content

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

W:\NEW TREE FORMAT\JOBS\772822\772822P>

With what little knowledge I have, I would say that should do it but it opens the file in CMD instead of the program that uses it. Well at least the syntax is correct

I'd be interested to know what occurs when you type:

Code: [Select]start "W:\NEW TREE FORMAT\JOBS\772822\772822P\772822-GH278-WAINWRIGHT-E-RS-FUL-CUSTOM.WBL"

at the command prompt.

What program is associated with wbl files? Does this program require the cmd shell to run or does it run in Windows? If it runs in the cmd shell, you may be able to run with cmd instead of start. The start command merely open another window but it's the association of the extension that determines what happens next. If it runs in Windows, you may be able to run it directly without the start and let Windows use the association to find the executable.

Oh yeah, where did this pause come from?

When I type that code in the command prompt it does the same thing as my last post with the new window thing.

The wbl files are associated with a program called Intellibuild. We use it at work to design wall panels. It runs from windows.

I added the pause so I could see what the window said before it closed.

OK going by what you said I just tried this

Code: [Select]@echo off
for /f "tokens=* delims=" %%x in ('dir /b "%~1\*.wbl"') do "%~1\%%x"
exit
And guess what... It works *almost* perfect.

I wasn't aware that you could run a program without the start command. Well, if anything this has really got me intrested in batch files and I'm going to start learning more about them.

Thanks for all your help Sidewinder.

Edit: Well there is still one problem. The cmd window stays open untill I exit the program. Is there a way to make it close after running the .wbl file?

2049.

Solve : Programming Help in VB 6!! Need 1 tip or 2?

Answer»

If i press the F1 i get "The MSDN collection does not exist. Please reinstall MSDN.
But i cant find MSDN. So i can't install it.

And Sendkeys "{enter}" can i write Sen keys "{u}" instead??
and how do i do to take the information from the text boxes and use that key??

By stop i mean to end the loop And Wait fore the F11 key to be pressed agen.

Both the F10 and F11 i want to be accessed even if i hawnt got my own prog selected.
This is what it locks like

Whid this i get a infernal loop when i press the F11 that i hawe to ctrl+alt+delet to get out off

still dont now if i kan stop the loop whid the F10 button but it started whid the F11

Code: (vb) [Select] Dim lop As Integer
Dim PS1 As Integer
Dim PS2 As Integer
Dim AS1 As Integer
Dim AS2 As Integer
Dim AS1a As Integer
Dim AS2a As Integer
Dim repetetimes As Integer
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Sub AS1C_GotFocus()
AS1C = ""
End Sub

Private Sub AS1T_GotFocus()
AS1T = ""
End Sub

Private Sub AS2C_GotFocus()
AS2C = ""
End Sub

Private Sub AS2T_GotFocus()
AS2T = ""
End Sub

Private Sub Form_Load()

Me.KeyPreview = True

End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)


start:
Debug.Print KeyCode, Shift
Select Case KeyCode

Case vbKeyF11

lop = 1
PS1 = CInt(PS1C.Text)
PS2 = CInt(PS2C.Text)
AS1 = CInt(AS1C.Text)
AS2 = CInt(AS2C.Text)
AS1a = CInt(AS1T.Text)
AS2a = CInt(AS2T.Text)
repetetimes = CInt(repet.Text)


SendKeys "{u}" ' press the u key
Sleep (500) ' wait for 0,5 sek

If PS1C <> "Input" Then 'If the txt box PS1C is not empty then contineu
SendKeys PS1 'press the button that is assigned to PS1C ex 1
Sleep (500) ' wait for 0,5 sek
End If

If PS2C <> "Input" Then 'If the txt box PS2C is not empty then contineu
SendKeys PS2 'press the button that is assigned to PS2C ex 2
Sleep (500) ' wait 0,5 sek
End If
'Do Until Case vbKeyF10 'stop running the prog when press the F10 button


Do While lop < repetetimes 'run this part the times specified in the "Times to repet" txt box

If AS1C <> "Input" Then
SendKeys AS1 'press the button that is assigned to PS1C ex 3
Sleep (AS1a) 'wait for the number in mS assigned in AS1T ex 5000 (5 sek)
End If

If AS2C <> "Input" Then
SendKeys AS2 'press the button that is assigned to PS1C ex 4
Sleep (AS2a) 'wait for the number in mS assigned in AS1T ex 3000 (3 sek)

End If

lop = lop + 1

Loop

SendKeys "{p}" ' press the p key
Sleep (10000) 'wait 10 sek
lop = 1 ' resett the lop
Case vbKeyF10
'DoEvents() ' if i delet the ' before the DoEvents() i get a "syntax error"
GoTo start
'Loop
End Select
End Sub

Private Sub PS1C_GotFocus()
PS1C = ""
End Sub

Private Sub PS2C_GotFocus()
PS2C = ""
End Sub

Private Sub repet_GotFocus()
repet = ""
End Sub
You had it right originally:

1. SendKeys "u"

I used a bad example, the curly braces are for keys on the keyboard that do not produce a character (like enter, tab, backspace, etc).

2. Do Until Case vbKeyF10 is ILLEGAL syntax; try Do Until vbKeyF10

Case is part of the Select construct.

3. Try using the DoEvents without the parenthesis. Not sure how helpful DoEvents will actually be; most times it's in a loop so the form can be updated. Hey! you never know.

I probably should have asked this a lot SOONER, but what version of VB are you using? If you're using an IDE, you can set checkpoints and then step into the code line by line to see how the program flows and what VALUES the variables have.



Maybe we should change the title of this post: "Re: Programming Help in VB!! Need 1 tip or 2"

The stop was only to inplement that i want the prog to stop running when the F10 was pressed
i kant make the DoEvents to wurk
i am using VB 6.0

and i gotten to prog to youst lock fore a few sek then write u12 (in the box i had seleckted) and make the num lock go on and off once

i still can't run the prog in eny other prog (like word)

This is the whole code now

Code: (vb) [Select]Dim lop As Integer
Dim PS1 As Integer
Dim PS2 As Integer
Dim AS1 As Integer
Dim AS2 As Integer
Dim AS1a As Integer
Dim AS2a As Integer
Dim repetetimes As Integer
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Sub AS1C_GotFocus()
AS1C = ""
End Sub

Private Sub AS1T_GotFocus()
AS1T = ""
End Sub

Private Sub AS2C_GotFocus()
AS2C = ""
End Sub

Private Sub AS2T_GotFocus()
AS2T = ""
End Sub

Private Sub Form_Load()

Me.KeyPreview = True

End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

'start:
Debug.Print KeyCode, Shift
Select Case KeyCode

Case vbKeyF11

lop = 1
If PS1C > -1 And PS1C < 10 Then
PS1 = CInt(PS1C.Text)
End If
If PS2C > -1 And PS2C < 10 Then
PS2 = CInt(PS2C.Text)
End If
If AS1C > -1 And PS1C < 1 Then
AS1 = CInt(AS1C.Text)
End If
If AS2C > -1 And AS2C < 10 Then
AS2 = CInt(AS2C.Text)
End If
If AS1T > 0 Then
AS1a = CInt(AS1T.Text)
End If
If AS2T > 0 Then
AS2a = CInt(AS2T.Text)
End If
If repet > 0 Then
repetetimes = CInt(repet.Text)
Else
MsgBox "You hawe to set more then that", vbInformation
End If


SendKeys "u" ' press the u key
Sleep (500) ' wait for 0,5 sek

If PS1C <> "Input" Then 'If the txt box PS1C is not empty then contineu
SendKeys PS1 'press the button that is assigned to PS1C ex 1
Sleep (500) ' wait for 0,5 sek
End If

If PS2C <> "Input" Then 'If the txt box PS2C is not empty then contineu
SendKeys PS2 'press the button that is assigned to PS2C ex 2
Sleep (500) ' wait 0,5 sek
End If
Do Until vbKeyF10 'stop running the prog when press the F10 button


Do While lop < repetetimes 'run this part the times specified in the "Times to repet" txt box

If AS1C <> "Input" Then
SendKeys AS1 'press the button that is assigned to PS1C ex 3
Sleep (AS1a) 'wait for the number in mS assigned in AS1T ex 5000 (5 sek)
End If

If AS2C <> "Input" Then
SendKeys AS2 'press the button that is assigned to PS1C ex 4
Sleep (AS2a) 'wait for the number in mS assigned in AS1T ex 3000 (3 sek)

End If

lop = lop + 1

Loop

SendKeys "p" ' press the p key
Sleep (10000) 'wait 10 sek
lop = 1 ' resett the lop
'Case vbKeyF10
DoEvents
'GoTo start
Loop
End Select
End Sub

Private Sub PS1C_GotFocus()
PS1C = ""
End Sub

Private Sub PS2C_GotFocus()
PS2C = ""
End Sub

Private Sub repet_GotFocus()
repet = ""
End Sub

Im i missing somthing??

If i change the 3 first wait commands it locks fore a longer period of time then write ute the u12 is there a sulution to make it right after line Code: (vb) [Select]SendKeys "u" it uses it not wait untill it hawe done all?You have a set of nested do loops but the outer loop is incomplete unless the Case vbKeyF10 line is commented out. I suspect you'll eventually need that case statement.

I may be missing something, but shouldn't PS1C and PS2C be initialized with values before you check to see if they are > -1 and < 10

The SendKeys "u" is correct syntax but the keystroke is at the cursor position. Where is the cursor? (I don't know either)

Quote

i still can't run the prog in eny other prog (like word)
I'm not sure where you're going with this but to run this within the Word application you'd need to run it as a macro.

VB is an event driven language which makes it perfect for interactive applications. Your program seems to be acting as both a program and a user in that it's creating the events and then running code in response. I know I'm a little slow on the uptake, but I still have no idea what you're trying to accomplish.

word was just a EXP i want to run it in 9Dragons a MMORPG

tis is what it locks like before i press the F11

Start F11
Stop F10

Skill Slot Time (mS)

Passive Skill 1 / 1 /
Passive Skill 2 / 2 /

Active Skill 1 / 3 / / 2000 /
Active Skill 2 / 4 / / 3000 /


Times to repeat / 5/

and if the cursor is located at the Times to repetwhen i press F11 it locks like this


Times to repeat /5u12/

if i hawe it at the Active Skill 1 it looks like this

Active skill 1 /1u12/

so the check
If PS1C > -1 And PS1C < 10 Then
PS1 = CInt(PS1C.Text)
End If
seems to work

Well i'm going on wecation now so i cant complet it before new year.

but i'l bump this later if i need more help

So werry christmas and a happy new year.Well i'm back and hawe the same problem.

What is does so far.

When i press the F11 button it locks fore about 1-3 sek and then it writes u and what i hawe wrutten in the first 2 text boxes then nothing more.

What i want it to do.

I want to be able to start it in eny program.
It wont lock when i press F11.(whrites the u and the first 2 boxes whidout locking)
It start writing the 3 and 4 text boxes(like this 3 wait 4 wait 3 wait 4 wait 3 wait 4 wait)
The 3 and 4 from the last example can be change to enyting betwene 0 and 9 and the wait can be changed seperatly in the 2 boxes on the right
The last box is for how meny times box 3 and 4 SHELL run before the prog press p
The F10 button whill stop the loop
All this whidout locking the computer betwene the writings.Well i made som changes.

Now it writes the 3 and 4 txt box and the p also but it still locks but i can move the mouse betveen the loops and i still can't start it whidout having it marked.

i think it can be the SendKeys command or the wait command


Code: (vb) [Select]Dim lop As Integer
Dim PS1 As Integer
Dim PS2 As Integer
Dim AS1 As Integer
Dim AS2 As Integer
Dim AS1a As Integer
Dim AS2a As Integer
Dim repetetimes As Integer
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Dim bCancel As Boolean

Private Sub AS1C_GotFocus()
AS1C = ""
End Sub

Private Sub AS1T_GotFocus()
AS1T = ""
End Sub

Private Sub AS2C_GotFocus()
AS2C = ""
End Sub

Private Sub AS2T_GotFocus()
AS2T = ""
End Sub

Private Sub Form_Load()

Me.KeyPreview = True

End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)


Debug.Print KeyCode, Shift
Select Case KeyCode

Case vbKeyF11
bCancel = False

PS1C.Enabled = False 'So that you dont change it when it runns

lop = 1
If PS1C <> "Input" And PS1C <> "" Then
PS1 = CInt(PS1C.Text)
End If
If PS2C <> "Input" And PS2C <> "" Then
PS2 = CInt(PS2C.Text)
End If
If AS1C <> "Input" And PS1C <> "" Then
AS1 = CInt(AS1C.Text)
End If
If AS2C <> "Input" And AS2C <> "" Then
AS2 = CInt(AS2C.Text)
End If
If AS1T <> "Input" And AS1T <> "" Then
AS1a = CInt(AS1T.Text)
End If
If AS2T <> "Input" And AS2T <> "" Then
AS2a = CInt(AS2T.Text)
End If
If repet <> "Input" And repet <> "" And repet > 0 Then
repetetimes = CInt(repet.Text)
Else
MsgBox "You hawe to set more then that", vbInformation
End If


SendKeys "u" ' press the u key
Sleep (500) ' wait for 0,5 sek

If PS1C <> "Input" And PS1C <> "" Then 'If the txt box PS1C is not empty then contineu
SendKeys PS1 'press the button that is assigned to PS1C ex 1
Sleep (500) ' wait for 0,5 sek
End If

If PS2C <> "Input" And PS2C <> "" Then 'If the txt box PS2C is not empty then contineu
SendKeys PS2 'press the button that is assigned to PS2C ex 2
Sleep (500) ' wait 0,5 sek
End If
DoEvents
Do While Not bCancel 'stop running the prog when press the F10 button


Do While lop < repetetimes 'run this part the times specified in the "Times to repet" txt box

If AS1C <> "Input" Then
SendKeys AS1 'press the button that is assigned to PS1C ex 3
Sleep (AS1a) 'wait for the number in mS assigned in AS1T ex 5000 (5 sek)
End If

If AS2C <> "Input" Then
SendKeys AS2 'press the button that is assigned to PS1C ex 4
Sleep (AS2a) 'wait for the number in mS assigned in AS1T ex 3000 (3 sek)

End If

lop = lop + 1
DoEvents
Loop

SendKeys "p" ' press the p key
Sleep (10000) 'wait 10 sek
lop = 0 ' resett the lop
'Case vbKeyF10
DoEvents
'GoTo start
Loop

Case vbKeyF10
bCancel = True
PS1C.Enabled = True

End Select

End Sub

Private Sub PS1C_GotFocus()
PS1C = ""
End Sub

Private Sub PS2C_GotFocus()
PS2C = ""
End Sub

Private Sub repet_GotFocus()
repet = ""
End Sub

-:Bump:-

Still need help-:Bump:-
2050.

Solve : Batch file to copy TIME as string?

Answer»

Running Windows XP SP2

I NEED to write a BATCH FILE to copy the CURRENT TIME, change the minute output minus 15 minus and then save it to a TEXT file.

Anyone have any ideas for me?