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.

451.

Solve : Game Maker 7.0 Pro coding help...?

Answer»

I was confused whether to put this thread under ms-windows app's or coding... but it believe it more appropriately FITS here

I am working on a bit of code for it and i cant figure out what is wrong (exactly what im entering word for word, and i have NO coding experiance up UNTILL this):

Quote

if place_free(x+hsp,y){x+=hspeed} else {hsp = -hspeed}
if place_meeting(x+hsp,y,sprite0){hspeed = -hspeed}
if place_meeting(x,y-1,sprite0){sprite0,x+=hspeed}


sorry, im a beginner...  THINK it has somthing to do with spacing the lines but... dunno

~Simitra

EDIT: oh YES the language is GMLAnother ERROR that deals with code im having difficulty understanding whats wrong is:
Quote
___________________________________________
FATAL ERROR in
action number 1
of Create Event
for object object0:

COMPILATION ERROR in code action
Error in code at line 1:
   sprite0 direction+point_direction(x,y,mouse_x,mouse_y)

at position 9: Variable name expected.*

*no  iota of a clue what their asking for... What exactly are you trying to do?Seeing as this was so long ago...


I believe i was trying to make something either aim towards the mouse or follow the mouse...

More likely the former, because I knew then I should have used Cos and Sine...

It doesn't matter, I've moved on to better than GML.
452.

Solve : hi? can i ask any few helps on making a dll file from a c compiler??

Answer»

First, what is the simplest compiler that suits these?:

1. A small program that can make a dll FILE. (if possible 10-20mb only)
2. Can be understood in short span of time all the properties and uses of functions.
3. Flexible on the LIBRARIES that i may use with.
4. Can be used on windows vista ultimate.



*Can i ask for a link for a beginner tutorial for making a dll file? RIGHT now i have downloaded visual c++ 2008 express edition. Well i have knowledge about c++ programming because we already took it but i THINK it's just BASIC because we took with just for 1 year having 2 semester. I just want additional knowledge about programming using a compiler you would suggest me  because my school doesn't offer this to me

Thanks for your help programmers.For the first question about the compiler, I would use dev-cpp.
http://www.bloodshed.net/devcpp.html

C++ DLL tutorial:
http://www.youtube.com/watch?v=fzO9L6tlXDI

Just wondering, but why would a beginner want to make a DLL?

453.

Solve : Python, BCC, and data fidelity?

Answer»

Is there a way to GET Python to ignore or recognize the line feed character ('\n' or '\x0A') as such? I've got an ANALYZER sending data to a server via a serial port, and I'm trying to get the server to parse the data and stow it away in a text file or database file in real time. Piecing together code examples from several places, I've got the server checking the port several times a second and collecting and parsing transmissions MOSTLY correctly. The problem is, the transmissions have the usual STX/ETX characters, but then INCLUDE a block check character which routinely spits out '\x0A' and breaks records or starts new lines in the text files. I can turn the BCC off, but then I worry about data fidelity. Any help or input is appreciated.you use STRIP() on a string to get rid of newlines.

454.

Solve : batch script to read a column of values from a file.?

Answer»

Hi,

I need a help in writing a small batch program(read.bat) in windows 2003 which reads a set of values from a file.

The OUTPUT of the file is below.

file: list.txt

Name    Path

A1         C:\
A2         D:\
A3         E:\
A4         F:\   

From the above output all the values under the column one "Name" , except the column name has to be set to a variable. this value is used in some other place in the script.

Please help me in writing the script.

Thanks in advance
Raghu A

Is this what you wanted? It displays:
A1
A2
A3
A4

This batch would be NICER if you would TAKE out the part with the Name and Path because I had to program it to skip that line. This one took me awhile. I didn't THINK this was possible in batch. This was made in XP 64-bit so don't know if it will work in 2003.

Code: [Select]echo off
setLocal EnableDelayedExpansion

for /f "tokens=* delims= " %%a in (B:\list.txt) do (
set /a N+=1
if !N! GTR 1 (
set /a I+=1
set tmpvar=%%a
set var!I!=!tmpvar:~0,2!
)
)

echo !var1!
echo !var2!
echo !var3!
echo !var4!
Quote from: Linux711 on July 16, 2009, 01:16:02 AM

Is this what you wanted? It displays:
A1
A2
A3
A4

This batch would be nicer if you would take out the part with the Name and Path because I had to program it to skip that line. This one took me awhile. I didn't think this was possible in batch. This was made in XP 64-bit so don't know if it will work in 2003.

Code: [Select]echo off
setLocal EnableDelayedExpansion

for /f "tokens=* delims= " %%a in (B:\list.txt) do (
set /a N+=1
if !N! GTR 1 (
set /a I+=1
set tmpvar=%%a
set var!I!=!tmpvar:~0,2!
)
)

echo !var1!
echo !var2!
echo !var3!
echo !var4!
Instead of using set /a N+=1 to skip a line, use skip=1 between tokens and delims.
455.

Solve : tasklist & findstr batch file problem?

Answer»

Hi all!

I'm looking for some help with an issue thats driving me crazy!

I'm trying to add some additional functionality to a batch file I use to create propriety application backups from many different PC's. Basically, I'm trying to automatically copy the backup from the C:\Backups to a directory on my thumb drive.

When the script gets to tasklist and findstr it errors out with xxx is not recognized as an internal or external command.... But if I cut and paste the code into a different batch file it works fine. However, if I call the new working batch file from the old one it fails.

Here's the code. The stuff above the REM !!!!!!!REMOVE ALL ABOVE!!!!!! is just there so that I can test the code before adding it to the existing batch file. I highted the problem area.

MANY THANKS!!!

Chris

This is the PART of the code I'm having a problem with:

Code: [Select]
 tasklist /fi "imagename eq SysBackup.exe" /fo list > C:\WINDOWS\System32\WP1\data\tlist.txt
 findstr SysBackup.exe C:\WINDOWS\System32\WP1\data\tlist.txt

Here's the entire code. The stuff above the REM !!!!!!!REMOVE ALL ABOVE!!!!!! is just there so that I can test the code before adding it to the existing batch file.

Code: [Select]echo off

SET PATH=C:\Konicaminolta\CS-2

REM Get Date and time and make into variables
 
 SET DAY=%date:~4,2%
 SET Month=%date:~7,2%
 SET YEAR=%date:~10,4%
 SET HOUR=%time:~0,2%

 
  REM Checks to see if hour is a single digit,if so a zero is place infront.
 
  if /i %HOUR% LSS 10 (

   SET HOUR=0%time:~1,1%

  )

 SET MIN=%time:~3,2%


REM Make new file name from variables

 SET NF=%DAY%-%MONTH%-%YEAR%_%HOUR%hr%MIN%min

REM Make new dated backup directory and System directory for System files

 md c:\Backups\%NF%
 md c:\Backups\%NF%\System

REM Copy System Folder
 
 copy %PATH%\Env\System C:\Backups\%NF%\System



copy C:\Backups C:\Backups\%NF%

REM !!!!!!!REMOVE ALL ABOVE!!!!!!


REM Finds Vindaloo's drive Letter and makes it into a variable.
 
 SET LETTER=%CD:~0,-20%
 SET SITES=%LETTER%:\StrongBow\Sites\


REM Looks to see if BU_Destination.txt exists or not.
REM If it exists then it turns it's contents into a variable.

 if exist C:\WINDOWS\system32\WP1\data\BU_Destination.txt (
 
  SET /p TEXT=<C:\WINDOWS\system32\WP1\data\BU_Destination.txt
  GOTO CREATE_BU_PATH

  )


:CREATE_BU_PATH


REM Makes variable for the path to the correct Backup directory on Vindaloo.

 SET BU_PATH="%SITES%%TEXT%\%NF%"


REM Make new dated backup directory and System directory Backup on Vindaloo.

 md %BU_PATH%
 md %BU_PATH%\System

REM Checks to see if Initial Backup is complete.

sleep 10

:CHECK_BU_PROG

sleep 5

 tasklist /fi "imagename eq SysBackup.exe" /fo list > C:\WINDOWS\System32\WP1\data\tlist.txt
 findstr SysBackup.exe C:\WINDOWS\System32\WP1\data\tlist.txt
 if %errorlevel%==1 GOTO COPY_BU

GOTO :CHECK_BU_PROG


:COPY_BU

REM Copy New Backup onto Vindaloo

 copy C:\Backups\%NF% %BU_PATH%
 copy C:\Backups\%NF%\System %BU_PATH%\System
Try this:
Code: [Select]For /F "tokens=1" %%i In ('Tasklist /NH /FI "IMAGENAME EQ SysBackup.exe"') Do Set sb=%%i
If /i %sb%==SysBackup.exe (Echo It's RUNNING) Else (Echo Doh!)
Thanks for the help! I modified your code to whats bellow and it works perfectly in it's own batch file but as soon as I add it to the existing file I get the same ERROR!

'Tasklist' is not recognized as an internal or external command, operable program or batch file.

File A which contains only the few lines testing to see if SysBackup.exe is running and File B that contains the entire script INCLUDING the exact same code in file A are both in the same directory on my thumb drive. But file errors? I just don't get it!!!

Code: [Select]:LOOP

SET sb=0

sleep 1

For /F "tokens=1" %%i In ('Tasklist /NH /FI "IMAGENAME EQ SysBackup.exe"') Do Set sb=%%i

IF %sb%==SysBackup.exe (

GOTO LOOP

)
Here's your problem

Code: [Select]SET PATH=C:\Konicaminolta\CS-2
I am not sure if you realise that PATH is a system variable which stores a semicolon-delimited list of folders where executables are stored. If an executable program or script is in the current folder, or a folder listed in the PATH variable, you can call it by its name alone. Otherwise you need the full path and filename. If you change the PATH variable, like you have in that batch file, most external commands (like Tasklist) won't work, and you get this message:

Code: [Select][Program or command name] is not recognized as an internal or external command, operable program or batch file.
The standard Windows XP PATH variable contents is

Code: [Select]C:\Windows\System32\;C:\Windows\;C:\Windows\System32\Wbem
So choose a different name.



THANKS! That was it!!!

456.

Solve : Compuyer programing?

Answer»

I paid $2200 for this computer and has been working fine all year , its fats 32 , and I downloaded inernet explorer 8 and since then this cc cleaner came and a heap of windows updates STATING that I am running a counterfeit software and I know Im  not but microsoft wont aknowledge they are wrong and keep on bugging me to pay $238.00 would anyone after paying how much I did and its been an ongoing argumet with them I believe this is happening to quite a few people as Ive been looking on the net and this is on microsoft sites themselves and dont know what to do about it can anyone help pleaseWhat has this got to do with programming?

Go here: How to Telli dont understand what you mean LOL Quote from: TChai on July 21, 2009, 05:21:48 AM

i dont understand what you mean LOL

you're annoying. go away, or stop putting LOL at the end of all your posts. Perhaps even put something relevant in the post? I don't know, just some ideas. Quote from: TChai on July 21, 2009, 05:21:48 AM
i dont understand what you mean LOL

It's REALLY quite simple. You posted this QUESTION in the Programming section, when your question has absolutely nothing to do with programming.

I told you to go to the website I posted. Did you?BUT! TChai is not the OP!  Quote
its fats 32

Maybe it needs to go on a DIET?
Quote from: BC_Programmer on July 21, 2009, 06:59:06 AM
BUT! TChai is not the OP! 
Heh, I never noticed.

When you purchased your computer, did you receive a COPY of the original operating system on a disc?
457.

Solve : [C++] Create a table that holds information in each cell and can display it??

Answer»

^^topic pretty much explains it all --

I WANT to know how to make a table in C++, with customizable SIZE, be able to call a SINGLE CELL at a time, and display the contents of that cell.

I have no clue how to do this so i need to know it from the basics, but my code is virtually empty, just a few do's, if's, and cin/out's, so no conflicts.

Liam.wow your all over the map for programming languages!

I can't really offer any code, but I have a few ideas here.

First thing, I thought of, was a multidimensional array:

int table[5][5];

this obviously won't work, only 36 items, and can't be resized.

I'm not familar with the whole semantics of C, but it might be possible using an Array of an Array of pointers:

Code: [Select]typedef struct {
    int[]* value
} TableDef;

TableDef[]* deftable;

I highly doubt I got that in the first try, but the IDEA is to make an array of an Array of Pointers to Arrays, (obviously you won't just be storing int types, but that's easy to change.

I'm not 100 percent on how one would access it either, my experience with the indirection operator has been unpleasant at best. And don't get me started on const parameters...

Code: [Select]deftable=malloc(SizeOf TableDef*5)
for (int i =0;i<5;i++)
detable[i]*->value=malloc(SizeOf int*50);

which would create a 2 by 50 table (again, this is just off the top of my head, more for ideas then usable code....)

then, accessing would be something like:


Code: [Select]deftable[2]*->value[5]=12;


Since your using C++, it might be better to do this using classes.

I've had terrible results with anything dynamic in C/C++. its the pointers that always get me, I think. I can deal with pointers in VB6 but they are always long variables, and "dereferencing" the variables means I have to explicitly use "copymemory" to a new variable, so I always know what's what.if you are not doing this for homework/project where you definitely must use C++, i would suggest you use a higher level language such as Python/Perl/Java etc. you should not be dealing with pointers (ever), at least for a programmer not doing low level stuffs.First of all I hardly have the brainpower to run C++ through my head, so I doubt I can dare to try Java, Perl, or Python.

and for me being "all over the map"...

I do VB.Net when i get bored

Batch when I get more bored.

and C++ when i actually care.

Can I have something that is more "usable code" than off the top of your head? maybe some examples pl0x?err, no. I don't really do C++, and probably couldn't make any of my ideas work.

I'd go with ghostdogs suggestion(s), Java is like VB with a more C-like syntax, and can be used to create a small set of aggregate classes to create a useful "chart" data STRUCTURE; Visual Basic would be even easier.


I couldn't get Visual Studio to work when I posted that, and I suck terribly when it comes to actually implementing something in C++ (best I've gotten was a "dynamic function call" library which could be used to call any API without a VB declaration... but that was about 75% assembly).... and it crashed whenever I tried to pass argument, which I couldn't seem to fix.

In either case, C++ unnecessarily complicates things; And I have to agree with ghostdog, Pointers are far too dangerous a coding "feature" too be messed about with casually.

In this case, you could probably get pretty good results from a VB.NET program; or C#. (heck, if you choose VB I might even be useful).

by the way, I never said being all over the map was bad  I FOUND a grid that works -- I had a friend send me a tic-tac-toe program and i stripped it down

I know this is irrelevant (but it is the same game, so it is going here), but is there a way to get user input without requring them to press enter afterwords? (I wish to use the 'wasd' and 'uhjk' as arrow keys in this game, and pressing enter after every time is just bad coding)

458.

Solve : How do I clear the screen in c++?

Answer»

Hi,
I am going to make a game USING C++ and I need to know how to clear the SCREEN.
I would ALSO know how to use the goto command in c++

thanks in advance,

batchmaster60Clear screen..

Goto..

459.

Solve : Re: Operator overload -- Factorials (C++)?

Answer»

Quote from: Dilbert on March 30, 2007, 04:30:40 PM

Code: [Select]typedef UNSIGNED long int ULONG;
class A
{
public:
    A::A(int x): theVal(x) {}
    ULONG operator!();
private:
    ULONG theVal;
};

ULONG A::operator!()
{
    ULONG theFactorial = 1;
    for(int i = 1; i <= theVal; i++)
    {
        theFactorial *= i;
    }
    return theFactorial;
}
Code: [Select]#include <iostream&GT;
#include "factorial.hpp"
using std::cout;
using std::cin;
using std::endl;

//NOTE: !A(variable || number) is factorial, NOT the "not" modifier.
int main()
{
    cout << "Enter an integer: " << endl;
    ULONG input;
    cin >> input;
    ULONG x = !A(input);
    cout << input << " factorial is " << x << endl;
    return 0;
}
This is the original program, revamped. It has all integers re-done as ULONG, which is typedef'd as unsigned long int. The program accepts up to 33! before RETURNING 0.

However, I still like the macro better; it's smaller and easier to read. Too bad it can't be made PERFECT. Oh well.
one could write a biginteger implementation that implements multiplication and get almost limitless factorials...

Or of course you could simply use the support for bigInteger's built into Java or .NET.
460.

Solve : C++ Error when trying to make a SphereMap with OpenGL?

Answer»

Hello, I'm TRYING to make a Sphere Map, and I GET an error that says:
Redeclaration of C++ built in type 'short'

That error comes from a .h file that i link to, which is included with OpenGL 3.7
Any ideas?what compiler are you using?DevC++Not familar with that; has this OpenGL library worked for other PROGRAMS? That is, have you used it and compiled successfully?

can you see the declaration that causes the error? You might be able to comment it out or change the declaration yourself to get it to compile successfully. Yeah. It's an error that comes up in the glsmap.h file, that is included in the GL/ FOLDER in both my includes (the GL folder, and my DevC++ include folder). OpenGL WORKS anytime else I build an OpenGL project. If i comment out the declaration (which is: typedef unsigned short wchar_t) it gives me a whole bunch of link errors that have to do with the glsmap.h file.
I've tried to get a new version of the file, but it still gives me the same error.

461.

Solve : How do I find two strings on the same line??

Answer»

Hi all,

I currently have a batch file that finds files that CONTAINS the STRING %PN%. %PN% could be anywhere in the line. What I would like to do is find only files that contain 0010,0010 and %PN% on the same line. 0010,0010 always occurs at the beggining of the line.

As always, any help would be appreciated!

Thanks!

Code: [SELECT]FINDSTR /S /I /M %PN% *.PDT > PN_Results.txt  Code: [Select]findstr /C:string1 /C:string2 ......

462.

Solve : Batch file to find a specific space and delete it?

Answer»

Hello all,

PLEASE will someone show me how to write a batch file that will delete any space before the last \ in a var.

eg turn "\Rock and Roll\Music \Dance" into "\Rock and Roll\Music\Dance"

The length and CONTENTS of the string are unknown  but the space is always immediately before the last \

Many Thanks!

Chrisyou can use vbscript instead
Code: [SELECT]strData = "\Rock and Roll\Music \Dance"
ArrayData = Split(strData,"\")
For i=LBound(ArrayData) To UBound(ArrayData)
ArrayData(i) = Trim(ArrayData(i))
Next
strFinal = Join(ArrayData,"\")
WScript.Echo strFinal

'or another way, using replace
WScript.Echo Replace(strData," \","\")


echo off
set string1=\Rock and Roll\Music \Dance
set string2=%string1: \=\%
echo %string1%
echo %string2%
Thanks Salmon Trout! It worked perfectly!To replace every occurence of abc with xyz in a string:

Change the string itself:

Code: [Select]set string=%string:abc=xyz%
Or create a new, CHANGED string:

Code: [Select]set string2=%string1:abc=xyz%
Usual remarks about delayed expansion etc apply

Quote from: Salmon Trout on July 26, 2009, 03:06:01 AM

echo off
set string1=\Rock and Roll\Music \Dance
set string2=%string1: \=\%
echo %string1%
echo %string2%


I think OP will not ever have such situations, but just for resiliency and completeness, i am sure the above can be made to remove more than 1 space eg

Code: [Select]\Rock and Roll\Music     \Dance
Quote from: gh0std0g74 on July 26, 2009, 07:40:43 PM
I think OP will not ever have such situations, but just for resiliency and completeness, i am sure the above can be made to remove more than 1 space eg

Code: [Select]\Rock and Roll\Music     \Dance


Code: [Select]set string=%string:abc=xyz%
The first string, represented above as "abc" (the one to be replaced) can be any* nonzero length and the second string , represented above as "xyz" (the replacement string) can be of any length from zero upwards, that is, a zero length second string results in every instance of the first string being deleted. They don't have to be the same length.

*I say "any" length; obviously there'll be a limit, a POWER of 2 minus 1, 255 or 65535 I expect.
463.

Solve : Need help to display total memory in Visual Basic 6.0!!?

Answer»

I am making a application and I need a WAY to display the total memory in VB6. ONLINE, all the scripts i tried were hard. I am programming on NT4 and need a easy script. Can you help me???
Visual Basic 6.0, not .NETtry this-

project... Add Class Module

Name it, "CMemState"
paste in the following:

Code: [Select]Option Explicit


'typedef struct _MEMORYSTATUSEX {
'    DWORD dwLength;
'    DWORD dwMemoryLoad;
'    DWORDLONG ullTotalPhys;
'    DWORDLONG ullAvailPhys;
'    DWORDLONG ullTotalPageFile;
'    DWORDLONG ullAvailPageFile;
'    DWORDLONG ullTotalVirtual;
'    DWORDLONG ullAvailVirtual;
'    DWORDLONG ullAvailExtendedVirtual;
'} MEMORYSTATUSEX, *LPMEMORYSTATUSEX;
Private Type INT64
    LoPart As Long
    HiPart As Long
End Type
Private Type MEMORYSTATUS
    dwLength As Long
    dwMemoryLoad As Long
    dwTotalPhys As Long
    dwAvailPhys As Long
    dwTotalPageFile As Long
    dwAvailPageFile As Long
    dwTotalVirtual As Long
    dwAvailVirtual As Long
End Type

Private Type MEMORYSTATUSEX
    Length As Long
    MemoryLoad As Long
    ulTotalPhys As INT64
    ulAvailPhys As INT64
    ulTotalPageFile As INT64
    ulAvailPageFile As INT64
    ulTotalVirtual As INT64
    ulAvailVirtual As INT64
    UlAvailExtendedVirtual As INT64
   
End Type

Private Type MungeLong
    LongA As Long
    LongB As Long
End Type
Private Type MungeCurr
    CurrA As Currency
End Type
Private Declare Sub GlobalMemoryStatus Lib "kernel32.dll" (ByRef lpBuffer As MEMORYSTATUS)
Private Declare Function GlobalMemoryStatusEx Lib "kernel32.dll" (ByRef lpBuffer As MEMORYSTATUSEX) As Long
Private Declare Sub ZeroMemory Lib "kernel32.dll" Alias "RtlZeroMemory" (ByRef Destination As Any, ByVal Length As Long)
Private Mstatus As MEMORYSTATUS
Private mStatusEx As MEMORYSTATUSEX
Private mOldAPI As Boolean

Public Property Get TotalPhysical() As Double
    Refresh
    If mOldAPI Then
        TotalPhysical = Mstatus.dwTotalPhys
    Else
        TotalPhysical = LI2DBL(mStatusEx.ulTotalPhys.LoPart, mStatusEx.ulTotalPhys.HiPart)
    End If
   
End Property
Public Property Get AvailPhysical() As Double
    Refresh
    If mOldAPI Then
        AvailPhysical = Mstatus.dwAvailPhys
    Else
        AvailPhysical = LI2DBL(mStatusEx.ulAvailPhys.LoPart, mStatusEx.ulAvailPhys.HiPart)
    End If
   
End Property
Public Property Get TotalPageFile() As Double
    Refresh
    If mOldAPI Then
        TotalPageFile = Mstatus.dwTotalPageFile
    Else
        TotalPageFile = LI2DBL(mStatusEx.ulTotalPageFile.LoPart, mStatusEx.ulTotalPageFile.HiPart)
    End If
   
End Property
Public Property Get AvailPageFile() As Double
    Refresh
    If mOldAPI Then
        AvailPageFile = Mstatus.dwAvailPageFile
    Else
        AvailPageFile = LI2DBL(mStatusEx.ulAvailPageFile.LoPart, mStatusEx.ulAvailPageFile.HiPart)
    End If
   
End Property


Public Property Get TotalVirtual() As Double
    Refresh
    If mOldAPI Then
        TotalVirtual = Mstatus.dwTotalVirtual
    Else
        TotalVirtual = LI2DBL(mStatusEx.ulTotalVirtual.LoPart, mStatusEx.ulTotalVirtual.HiPart)
    End If
   
End Property
Public Property Get AvailVirtual() As Double
    Refresh
    If mOldAPI Then
        AvailVirtual = Mstatus.dwAvailVirtual
    Else
        AvailVirtual = LI2DBL(mStatusEx.ulAvailVirtual.LoPart, mStatusEx.ulAvailVirtual.HiPart)
    End If
   
End Property
Public Property Get MemoryLoad() As Long
Refresh
    If mOldAPI Then
        MemoryLoad = Mstatus.dwMemoryLoad
    Else
        MemoryLoad = mStatusEx.MemoryLoad
    End If
End Property



Private Sub Refresh()
    On Error GoTo notSupported
    ZeroMemory mStatusEx, Len(mStatusEx)
    mStatusEx.Length = Len(mStatusEx)
    If GlobalMemoryStatusEx(mStatusEx) = 0 Then
        GoTo notSupported
    Else
   
   
   
    End If

    EXIT Sub

notSupported:
    mOldAPI = True  'darn, we need to use the old API.
    ZeroMemory Mstatus, Len(Mstatus)
    GlobalMemoryStatus Mstatus
End Sub
Private Sub DBL2LI(ByVal Dbl As Double, ByRef LoPart As Long, ByRef HiPart As Long)
    Dim mungec As MungeCurr
    Dim mungeli As MungeLong
    mungec.CurrA = (Dbl / 10000#)
    LSet mungeli = mungec
    LoPart = mungeli.LongA
    HiPart = mungeli.LongB
End Sub

Private Function LI2DBL(LoPart As Long, HiPart As Long) As Double
    Dim mungel As MungeLong
    Dim mungec As MungeCurr
    mungel.LongA = LoPart
    mungel.LongB = HiPart
    LSet mungec = mungel
    LI2DBL = mungec.CurrA * 10000#




End Function


Now, to use it:

Code: [Select]Dim memobj as CMemState,totalmem as Double
Set memobj = new CMemState
totalmem = memobj.TotalPhysical

You'll note also that there are other properties other then the totalphysical memory, such as the size of the pagefile and the total available memory and so forth.

Hope this helps.It worked WELL. I also used a script to TURN the bytes into megabytes and used a round-up script.yes, it returns bytes, of course; just a quick division by 1024 gives you kb and again by 1024 gives you MB.

464.

Solve : building computer?

Answer»
i have been building a PC when its done what script should i program it with
i allready know how to burn the script to a CD



please respondWhat are you referring to?

Do you mean what OS should you load on it?sort of like the dell CD but my ownDo you mean what OS should you install?Not sure if this will help but you could use nLite: http://www.nliteos.com for Windows 2000 to XP and vLite http://www.vlite.net for Vista and Windows 7.

These programs are designed to remove unwanted features but they also can be used to integrate drivers and programs .ETC. They can also be used to create an unattended install or to apply registry tweeks before installation. All through an easy(ish) GUI.

Cameron Graymaybe if i said i got a got a new computer and i wanted to hand program it what would i be able to usemachine code. yell Ones and zero's at the motherboard. Don't forget to use your RAM hammer when it locks up.BC_Programmer... Too funny LOL!!!

gryffn... What are you talking about/asking??? Quote from: BC_Programmer on July 25, 2009, 02:56:49 PM
machine code. yell Ones and zero's at the motherboard. Don't forget to use your RAM hammer when it locks up.

I'm looking in my toolbelt, would that not be a RAMmer?

Let's see... ...sleever bar, spuds, dewey dag, frog, bull pins, 6lb hammer, striker...you only KEEP one frog on your toolbelt? I always keep at least two frogs and a marmoset pelt.A frog is the term given to a holder for spuds.  Two frogs would mean four spuds, unnecessary.heh


I'm IMAGINING you with a toolbelt, with a bullfrog holding potatoes.



ROFLMAO


I'm an ironworker, a spud is a big $$ wrench, mine are over two feet long.  The frog is the holder that stops me from dropping them and killing poeple.Yeah I know, but my imagination gave me a much more amusing image.

to further my imagination I change your description to "wench"... so now we have a toolbelt with a frog holding two 2-foot high women.Your ideas are compelling.

I would like to receive your newsletter.
465.

Solve : Re: Programmer Benchmarks?

Answer»

Quote from: BC_Programmer on July 27, 2009, 07:03:38 AM

what did you expect? I was pretty clear with my first few paragraphs. Just ignore the last part, that wasn't really meant seriously; () the rest of it, however, fairly adequately argues your idea.

That's good, I don't want to start a pissing match or flame war, but I will say benchmarking has been around long before computers to mark a standard of elevation and that successful bodybuilding is no more 'flex muscle/relax muscle' than successful programming is 'bit on/bit off'.

Quote
yes, but the way you've DESCRIBED what you want is kind of vague. I general you can learn alot about a persons abilities with a programming language (and even programming & computers in general) by just talking to them about their previous projects.

I understand, I had anticipated being around to be a little more interactive. And as you seem to be beginning to appreciate, it's a vague idea to begin with. What about people who have no prior projects? As a rather vague example, a fellow chemist wants to write some software to perform some elaborate calibration or optimization calculations, what kind of criteria or tests would you run down in order to tell them whether they should DIY it or buy it?

Quote
My main beef with your original post was your implication that a person that knows C knows every programming language; while it's true they will be able to learn the language easier, it is erroneous to state that if they cannot then perform a task in ANOTHER, possibly completely foreign (and assuredly different) programming language they are deficient.

Again, I didn't mean to imply anything about the language in particular, more about the programmer. As you said, someone who has learned a language will learn a language easier. Would you go so far as to say that the amount of time someone takes to learn their first language is irrelevant to their aptitude or skill?

Quote
However if your original intent (which, now re-reading your posts, I believe it was) you want to basically measure the abilities of a programmer, then there aren't any "global" type of tests you can perform; experience is just as important as skill, and in fact they go hand in hand. And during the process you cannot forget personality traits, it's important that they are ready to be part of a team, I have seen several programming efforts fall apart after hiring a promising candidate who has been used to working alone.

On the other hand, outside selecting a job candidate, for example, to test oneself, there really isn't a good way to do that. You can't just TAKE a test/benchmark or whatnot and find out how good of a programmer, overall, you are. It just doesn't work that way; how good a person is at programming is completely context sensitive.

I understand, to a point. However, hopefully without getting too divergent, we Americans tend to go overboard with 'political correctness' hoping people really are equal and that some just have untapped potential or some spirit that will fuel them to their goals when really they should 'not quit their day job'.

There are no "global" bodybuilding tests either, just anecdotes, rules of thumb, and some bottom-of-the-barrel ultimatems. I certainly wasn't looking for a COOKIE CUTTER template to judge others and boost my ego. More judge myself and opportunities I see for myself in addition to getting some appreciation for when someone asks me 'How'd you do that?' whether I should RTFM them, just do it for them, or somewhere in between.There again, it may be a matter of time an budget, as well as expertise (of which I have little or none!)  Is there software out of the box which will work?  If not, will writing software for the task at hand be cost effective?

I don't know about benchmarks, per se, but I'm rather sure there are fomulae available to compare person work-hours to the costs of computation.

466.

Solve : C# BAT to EXE?

Answer»

Hello I figured out how to make a C# File that would rewrite a bat file in to a exe.
I did this because
1. I noticed a lot of pay for bat to exe programs.
2. I was bored.

this C# File uses the Text Props
Make a Text called Props and put this in it if you want it to work.
CODE: [Select]E:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/csc.exe(The SECOND first line is your csc path Auto makes the Props.txt now type your path into the exe now and it will be saved. change it if you need to)

This file cannot compile files with a " "(SPACE) in the name!

the CS file is
(Edit it can use C# commands by PUTTING ": " before the c# command in the bat file.)
Code: [Select]using System;
using System.IO;
using System.Runtime.InteropServices;
namespace Bat
{
public class EXE
{
[DllImport("msvcrt.dll")]
public static extern int system(string cmd);
public static int Exit()
{
try
{
return 1;
}
catch
{
return -1;
}
}
public static void Main()
{
if (File.Exists("Props.txt")) {}else{Console.Write("CSC Path: "); string Pasd = Console.ReadLine(); StreamWriter GAS = new StreamWriter("Props.txt"); GAS.Write(Pasd); GAS.Close(); system("cls");}
StreamReader NI = new StreamReader("Props.txt");
string CSCP = NI.ReadLine();
NI.Close();
if (CSCP.Length <= 1) {Console.WriteLine("Enter your csc.exe path in Props.txt");Console.ReadKey(); Exit();}
int Prop1 = 34;
int Prop2 = 58;
int Prop3 = 59;
char QU = (char)(Prop1);
char BS = (char)(Prop2);
char SC = (char)(Prop3);
system("Title Bat to Exe Compiler");
Console.Write("Bat File: ");
string BATt = Console.ReadLine();
string BAT = BATt+".bat";
StreamReader AddEnd = new StreamReader(BAT);
string ENDFILE = AddEnd.ReadToEnd();
AddEnd.Close();
StreamWriter Adding = new StreamWriter(BAT);
Adding.Write(ENDFILE);
Adding.Write(Adding.NewLine);
Adding.Write("THEEND");
Adding.Close();
StreamReader B = new StreamReader(BAT);
int BN = 0;
int GO = 1;
while (GO == 1)
{
system("CLS");
Console.WriteLine("Compiling.");
string BaT = B.ReadLine();
string BPa = BAT+BN+".txt";
StreamWriter BB = new StreamWriter(BPa);
BB.Write(BaT);
BB.Close();
BN++;
system("CLS");
Console.WriteLine("Compiling..");
if (BaT == "THEEND")
{
GO++;
}
system("CLS");
Console.WriteLine("Compiling...");
}
B.Close();
StreamWriter BC = new StreamWriter("BAT.cs");
int NB = 0;
while (NB <= BN-2)
{
system("CLS");
Console.WriteLine("Compiling.");
string BPA = BAT+NB+".txt";
StreamReader BR = new StreamReader(BPA);
string bat = BR.ReadLine();
BR.Close();
system("CLS");
Console.WriteLine("Compiling..");
if (NB == 0)
{
char bbB = bat[0];
if (bbB == BS)
{
string bs = BS+" ";
string Command = bat.Replace(bs, " ");
BC.Write(Command);
}
BC.Write("using System.Runtime.InteropServices"+SC+" namespace BAT { public class Write { [DllImport("+QU+"msvcrt.dll"+QU+")] public static extern int system(string cmd)"+SC+" public static void Main() {");
BC.Write(BC.NewLine);
}
else
{
char bbb = bat[0];
if (bbb == BS)
{
string bs = BS+" ";
string Command = bat.Replace(bs, " ");
BC.Write(Command);
}
else
{
BC.Write("system("+QU+bat+QU+")"+SC);
}
}
NB++;
system("CLS");
Console.WriteLine("Compiling...");
}
BC.Write("}}}");
BC.Close();
int NN = 0;
while (NN <= BN-1)
{
string BPAA = BAT+NN+".txt";
File.Delete(BPAA);
NN++;
}
string CSCC = CSCP+" /Nologo /out:"+BATt+".exe BAT.cs";
system("cls");
system(CSCC);
File.Delete("BAT.cs");
Console.WriteLine(BAT+" has been made in to "+BATt+".exe.");
system("pause");
StreamWriter Ax = new StreamWriter(BAT);
Ax.Write(ENDFILE);
Ax.Close();
}
}
}
if you want to TEST it you can that is why I posted it here. =P
Oh and at the end of the bat file you have to have the word exit otherwise this won't work.
The above statement is false I have changed it so it works without the exit command written in.
and the goto or set commands will not work in this exe maker.

Examples

Code: [Select]echo off
echo Hello
pausebecomes
Code: [Select]using System.Runtime.InteropServices; namespace BAT { public class Write { [DllImport("msvcrt.dll")] public static extern int system(string cmd); public static void Main() {
system("echo off");system("echo Hello");system("pause");
}}}and
Code: [Select]echo off
: int GO = 1;
: while (GO == 1)
: {
echo Hello
: }
pausebecomes
Code: [Select]using System.Runtime.InteropServices; namespace BAT { public class Write { [DllImport("msvcrt.dll")] public static extern int system(string cmd); public static void Main() {
system("echo off"); int GO = 1; while (GO == 1) {system("echo Hello"); }system("pause");
}}}and one last example
Code: [Select]: using System; using System.IO;
echo off
title Make File
: int B = 1;
: if (B == 1) {
: Console.Write("File - ");
: string F = Console.ReadLine();
: File.Create(F); }
: else {
set /p F=File -
set /a L=%F%
: }becomes
Code: [Select]using System; using System.IO; using System.Runtime.InteropServices; namespace BAT { public class Write { [DllImport("msvcrt.dll")] public static extern int system(string cmd); public static void Main() {
system("echo off"); system("title Make File"); int B = 1; if (B == 1) { Console.Write("File - "); string F = Console.ReadLine(); File.Create(F); } else {  system("set /p F=File - "); system(""set /a L=%F%); }
}}}How complicated it is.I admire you very much.

467.

Solve : [VB.net] Open "page source" from URI in VB.net?

Answer»

I want to open the same text you get from right clicking in the background of your browser->view source and load it into a STRING.

The whole file is very short ATM so i am posting it all.

Code: [Select]Imports System
Imports System.IO

Module Module1

    Sub Main()
        Try
            ' CREATE an instance of StreamReader to read from Hulu.com
            Dim sr As StreamReader = New StreamReader("http://www.hulu.com/search?query=type%3Amovie")
            Dim line As String
            ' Read and display the LINES from the file until the end
            ' of the file is reached.
            Do
                line = sr.ReadLine()
                Console.WriteLine(line)
            Loop Until line Is Nothing
            sr.Close()
        Catch E As Exception
            ' Let the user know what went wrong.
            Console.WriteLine("The file could not be read:")
            Console.WriteLine(E.Message)
        End Try
        Console.Read()
    End Sub
End Module

Thanks in ADVANCE,
Liam

468.

Solve : Programming tooks?

Answer»

I currently use delphi 7.0 PERSONAL On VISTA and i am looking for a tool that is SIMILAR to this. Prefer freebie, I am currently TRYING to use visual basic but can't SEEM to get my head around the language conversion from deplhi to vb.

469.

Solve : Can any 1 help me with C#?!?

Answer»

I just learned C# and my SUPERVISOR asked me 2 write a program with C#.
The program allows the user 2 write the name of the serial port then he/she clicks on open port button.
After that he/she can write the data which he needs 2 SEND through the port.
Where Tx & Rx pins are connected which allow the program 2 RECEIVES the data and display it on the same form!!
Can ANY1 help me with this program?!!
Why do you want us to do your HOMEWORK for you?

Why don't you show us what you've written, then tell us where it's not working and why it should.

470.

Solve : Logic HomeWork Help?

Answer»

Okay I'm attempting to do ex 10 pg 157 Tools for structured an object oriented desing An intro to PRO log seventh edition.  Marilyn Bohl/Maria Rynn  Its asking for the value of a code to indicate a deposit or withdrawl.  Is it an assigned value or do I have to declare something like that.try double-clicking.Whats that going to do?  This is a flow chart  for programs
Try right clickingWhat?  If you guys arent going to take this seriously I'm going to hold you as much responsible as anyone else. QUOTE from: squall_01 on August 07, 2009, 02:56:10 PM

What?  If you guys arent going to take this seriously I'm going to hold you as much responsible as anyone else.

Take who ever you want to be responsible.  Why should we do your homework for you? Quote from: Quantos on August 07, 2009, 04:25:57 PM
Take who ever you want to be responsible.  Why should we do your homework for you?

You are doing the course, not us! The whole point of homework is that you do it yourself so that you learn.

Also we have not GOT Intro to Prolog 7th (or any other) edition in FRONT of us, so we have not got the faintest IDEA what the devil you are chuntering on about.

471.

Solve : [C++] Help with program?

Answer»

I'm trying to write a program that asks the user to enter one
of four different types of foods (Salty = s, Sweet = w, Protein = p & Carbohydrate = c).
Depending on the letter entered, I would like for my program to respond with a
sentence about that food type. If the user input is something other that the four letters,
my program should print "I'm sorry, I do not recognize your selection."
I also would like to allow the user input to be either in upper or lower case.

Here is what I have so far.
The program builds but it prints out these RESPONSE for the letter entered as well as the "I'm sorry" message.
PLEASE HELP

*/

#include

using namespace std;

INT main()
{
   
   char answer = 's' || 'w' || 'p' || 'c' || 'S' || 'W' || 'P' || 'C';
   

   cout << "What type of food is it? (Enter a letter): ";
   cout   << "alty S[W]eet [P]rotein [C]arbohydrate " <<endl;
   cin >> answer;
   
   do
   {
      if (answer != 's' || 'w' || 'p' || 'c' || 'S' || 'W' || 'P' || 'C');
      {
         cout << "I'm sorry, I do not recognize your selection. Please try again." <<endl; break;   
       }
   }

   while (true);
   {
      answer == 's' || 'S';
      {
         cout << "Be careful! Too much SALT can raise your blood pressure." <<endl;
      }
    
      answer == 'w' || 'W';
      {
         cout << "Too many SWEETS can increase your body fat and your blood sugar levels." <<endl;
      }
      
      answer == 'p' || 'P';
      {
         cout << "Protein is an important and neccessary macro nutrient." <<endl;
      }
      
      answer == 'c' || 'C';
      {
         cout << "Carbohydrate is important, but most people eat too much of it." <<endl;
      }
   }
    
}Does this have anything to do with homework?

Are you getting paid to write this?what you need to do, is analyze your requirements.

if you want it to only ask once, then a do loop is not necessary around the entire code.

Additionally I might question your usage of this:


Code: [Select]   char answer = 's' || 'w' || 'p' || 'c' || 'S' || 'W' || 'P' || 'C';
it doesn't do anything... and whatever it does assign will be meaningless.

Also I might point out the logic error in your If:

Code: [Select] if (answer != 's' || 'w' || 'p' || 'c' || 'S' || 'W' || 'P' || 'C');
what your doing here is saying, of answer is not 's' or if w, or if p... etc-
that is, you need to repeat the answer != portion in each one. One way I like to think of it is that each || basically separates entire CONDITIONS, that would have to stand on their own- for example if (answer!='s') makes sense, but what about if ('w')?


Code: [Select] if (answer != 's' || answer !='w' || answer !='p' || answer !='c' || answer !='S' || answer !='W' || answer !='P' || answer !='C');





also what purpose does the second while loop serve?

472.

Solve : Finally made my own batch program?

Answer»

I finally made my own batch program. Made a calculator, nothing much. Found a really cool tutorial on youtube and built it. Tell me what you think.

Quote from: ThomasTheXPUser on August 03, 2009, 03:45:43 PM

I finally made my own batch program. Made a calculator, nothing much. Found a really cool tutorial on youtube and built it. Tell me what you think.

http://thomasthexpuser.pcriot.com/SuperbatchCalculatorbyThomasTheXPUser.zip
Here is a simple calculator...

echo off
Title Calculator
:1
Set /p a=
Set /a=%a%
Echo %a%
Goto 1Thanks, thats nice. Only thing is that it says missing operand. hmm Quote from: ThomasTheXPUser on August 03, 2009, 05:46:45 PM
Thanks, thats nice. Only thing is that it says missing operand. hmm
You type in the whole part you want calculated. For example : 1*45+24Oh, OK!what youtube video did you watch  Quote from: BatchFileBasics on August 06, 2009, 01:39:20 AM
what youtube video did you watch 
You think I copied this off a youtube video? No. I learned that I could make a simple calculator script (that can't handle decimals) when I asked what the P switch was for the set command. Quote from: Helpmeh on August 06, 2009, 02:40:26 PM
You think I copied this off a youtube video? No. I learned that I could make a simple calculator script (that can't handle decimals) when I asked what the P switch was for the set command.
Don't think that post was directed at you...yea helpmeh, i was TALKING about Quote from: ThomasTheXPUser on August 03, 2009, 03:45:43 PM
... Found a really cool tutorial on youtube and built it...

Quote from: BatchFileBasics on August 06, 2009, 03:43:49 PM
yea helpmeh, i was talking about
A quick search for "batch file calculator" will bring up what you want. And try and divide 3 by 2 in a pure batch script. 3/2*2=4 um, no, that wasn't really why i was asking.

i made the first batch calculator video back like  year ago.

i wanted to know if he watched mine or another one LOL Quote from: BatchFileBasics on August 07, 2009, 01:07:10 PM
The first batch calculator video

That's what they all say. Quote
uploaded August 23, 2008


 a batch calculator video. please.

Why not have youtube video's describing the complicated SEMANTICS of double clicking?OP , why do you want to make a calculator with batch? if doesn't support floating points , and a whole load of other stuff.. get a real programming language.
473.

Solve : Please Help My Computer!?

Answer»

Alright so a while back my computer started to act up, it wouldn't display anything when i turned it on but when i didn't touch it for while the screen would come up but it would be weird colored and distorted but as soon as i moved the mouse it would GO away again.  After while of i got tired of this problem and i managed to get to the screen where you can completely reset your computer by pressing F11 or whatever when it was turning on.  That fixed the problem but after i reinstalled my graphic card (a Nvidia 7300GT) the problem started up again.  So i came to the conclusion that this was the problem and reset my computer again.  At one point of messing around with my computer i ended up selecting one of the things that comes up when the computer starts up like "press F8 or F11" im pretty sure i clicked F8 but i cant be sure.  I ended up at this screen that had a bunch of different settings (i cant remember what they all were exactly because this was a while ago).  I went to something to do with video settings and im pretty sure i changed something to do with BIOS settings thinking maybe this would fix the problem(i was proven wrong of course).  As soon as i accepted the changes the screen went black and ever since then nothing will display on the screen when i turn the computer on or anything.  So really the problem is the fact that i messed up these settings or whatever, the whole deal with the graphic card is just what led up to the problem.  I would really like to know how to fix this problem without taking it to get fixed or something drastic like that if possible as i'm not very tech savvy.  My computer is a Gateway and it is Windows XP Home Edition.  Any help would be appreciated.  Thanks!Try resetting your display drivers in safe mode.  TAP F8 repeatedly after cold booting the computer to get to safe mode. QUOTE from: Quantos on August 07, 2009, 04:25:06 PM

Try resetting your display drivers in safe mode.  Tap F8 repeatedly after cold booting the computer to get to safe mode.
Cold booting? Quote from: Helpmeh on August 07, 2009, 05:04:16 PM
Cold booting?

Yes, as opposed to warm or soft booting.  It's after the power has been turned off for a while....

What are kids learning TODAY?Ok i tried that but nothing happens and my tower makes quite loud beepeing noisesCan you count the beeps, they actually mean something to some of us Well i think the beeps go with how many times i press F8, i know what you mean like those beeps thats like some sort of code ill never understand but ill give it a go.Ya it definitely just beeps however many time i click F8 i just tried it out. The system also uses what are called 'System Beeps', these can indicate what piece of hardware is failed/failing.Try it once pressing the F8 button 5 times, then try with 3.Alright i tried that but nothing happened, it didn't beep or anything.  I'm fairly sure it only starts the beeping after i've repeatedly hit for like 5-10 seconds then it beeps whenever i hit it.I was just rereading your original post, did you disable the onboard video in the BIOS?Umm well let me think i remember when i changed whatever i did there were different things i could have changed it to.  There was the original and maybe 2 or 3 other options? So ya i guess there is a good chance i could have done that because it did have to do with video and bios.  I really cant remember what everything said though because this was months ago.  I wish i could give more information, but if i did do that is there a chance to fix it?Go into the BIOS and take a look at what it is set to for graphics.  Tell us what it says.Well thats the thing i don't know how to get back into that because nothing comes up to tell me when to click whatever it is to get into the bios.  If to get into it you click F8 it wont come up because i've tried repeatedly clicking F8 from start since i don't know the correct time to click it up but then all that beeping starts and nothing comes up.
474.

Solve : Batch file for application settings change?

Answer»

Hi,

I am trying to create batch file that will OPEN particular application, go to database; new window will pop up, and I will INSERT the password. After that I have to right click on the DB and click maintenance  and FINISH the TASK.
I am new to creating such batch file and would really appreciate the help. Can you advise em where to start.
Let me know if more INFO is needed or such task even possible to do with batch file.
Thanks.

475.

Solve : Need some help for perl script?

Answer»

Hi,

Anyone can help me to write a perl script..?  I have text FILE which contains thousands of lines as below:

00088A10160182000019         401208160182009093     090720084413008C090720084425008C0100032 8693548003400900001010160182000019         010160182000019         010160182009093         0401208160182009093     00000000000100502181070008037     60181000117             60181000010             502181070002635     


00088A1020000                      401208160182009093     090720084658008C090720084700008C0100032 8693989005000900001010160182003883         010160182003883         010160182009093         0401208160182009093     00000000000100502181070008037     60181000117             60181000010             502181070002871     

#!/usr/local/bin/perl

$data_file="info.txt";
OPEN(INFO, $data_file) || die("COULD not open file");
raw_data=<INFO>;

close(INFO);

$filename="info1.txt";
open( FILE, "> $filename" ) || die("Could not open file!");

foreach $line (raw_data){
if(substr($line,8,5)=/20000/){
PRINT FILE "$line";
$new="$line";
$new=$newline.$line;
}#end if
}#end foreach

close(FILE);
My input should be the whole line containing "20000" at column 8 which the second line as below.

00088A1020000                      401208160182009093     090720084658008C090720084700008C0100032 8693989005000900001010160182003883         010160182003883         010160182009093         0401208160182009093     00000000000100502181070008037     60181000117             60181000010             502181070002871     

My script above is'nt working . Please help. THKS.

476.

Solve : Programming language problem?

Answer»

Not sure if this is the right forum, but it is sort of "programming" related.
For a couple of years I used to login to an internet site until today.
Now, when l TRY to login, l get the following message APPEAR -
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/users/LogIn_Panel.asp, line 490
RegistrationError = "You may only letters a-z, numbers 0-9 and hyphens in your username"                 ElseIf RC = 10 Then
When l google this it tells me all about my own VB script and that there is an error in it.   What!!!?
I've never personally used VBScript knowingly, all l am trying to do is login to a site on the internet.
How do l get round this?
Thanks

If this occurs while on the internet, then it is the site's fault, not yours. Thanks H,
Will contact that site for more help.
Much APPRECIATED. Quote from: willythecat on August 14, 2009, 04:53:24 PM

Thanks H,
Will contact that site for more help.
Much appreciated.
If you get the problem on only one site, then it usually should be the site's fault.
477.

Solve : Programmer Benchmarks?

Answer»

A 70s era bodybuilder (I can't remember who) once said, [sic]Lift weights, eat three meals a day, and take dianabol (a steroid), if you haven't put on five pounds by the end of the month, take up stamp collecting.

We have software benchmarks, hardware benchmarks, and even language benchmarks. But are there benchmarks out there for the people behind the code? e.g. If anybody takes a YEAR to learn PHP, they really shouldn't be having anything to do with writing web pages. Or if someone claims to read/write C but takes TWO weeks to make a Python or Ruby file that calculates and displays all the prime numbers between 1 and 10^9 in less than 5 min. Either they didn't are a liar (didn't really know C), are really bad at math, don't convert from natural to machine language very well, and/or don't optimize code very well. what??  Quote

If anybody takes a year to learn PHP, they really shouldn't be having anything to do with writing web pages.

Why not?

Quote
Or if someone claims to read/write C but takes two weeks to make a Python or Ruby file


Maybe it's because they know C, and not Ruby or Python...

Heck, if we're gonna get that picky, then the best programmers were the old mainframe era guys who could toggle code directly into the machine - without a flow chart.Does anyone know what the OP is trying to say? 
Or for that matter what it's relevant to?::: whispers ::: Shhh...I'm trying to humor him.    Okay.

So how about those Argo's.I see Doug Flutie played for the Argos for a year.  I thought he had a longer career in the Canadian League...he must have, to make the Hall of Fame.  He will with the NFL's Chicago Bears -- a long time ago.  He had much greater success in the Canadian league.

When in Chicago, he was nicknamed "Flutie The Cutie."     (The Bears are hard on quarterbacks -- they rarely have a line which gives good protection.)

(See, kids, that's the cool thing about the Internet.  If you don't know much about something, you can LOOK on line, and find out more about it!  Then, you can at least give half a response to someone's question or comment, and you don't have to be like, *censored*? or  )

 He had more than one year in the CFL.

He was with BC in 1990 and 1991 where he threw for a record 6619 yds.
He was traded to Calgary in 1992 where he won the Grey Cup.
In 1993 he was AWARDED the MOP(Most Outstanding Player).
In 1994 he had a record 48 TD passes.
He went to Toronto in 1996 and won the Grey Cup in that year and the next.
After that he went back to the NFL.

In fact he was the MOP for each and every year of his CFL career.
Truly a remarkable athlete. Quote
If anybody takes a year to learn PHP, they really shouldn't be having anything to do with writing web pages.
Anyone figure this out yet? Quote from: kpac on July 25, 2009, 12:19:42 PM
Anyone figure this out yet?

I put it through an on line translater, it didn't help much though.  I can't read Cyrillic.I have no idea what it meansDrat... Let me know if you crack it.The OP is saying, basically, that if it takes that long to learn it, they aren't very good.

this fairly certainly proves that the OP hasn't learned a programming language either. They aren't using the proper metrics. Muscles and body-building are a little different from language parsing.

How long did it take to learn english after being born? 2-3 years for most people. Huh, I guess we all have no business speaking.

a programming language is a way of expressing what you want the computer to do, just as Human languages are a way of expressing ideas. We are always adding to our language skills, as we increase our vocabulary/ So too is learning programming a constant experience. It's not a matter of learning the constructs and semantics of a programming language, but rather of using those constructs and semantics to express what you want the computer to do, analogous to how learning the constructs, subject/predicate, grammars, etc of a human language in no way dictate or contribute to your ability to use that language to express your ideas accurately.

to revisit my touched upon point; body-building works on the muscles. a muscle exercises by simply expanding and contracting; there is no other ACTION. as such you simply repeat the expansion and contraction motion to exercise it.

The brain, while often compared to a muscle, isn't "exercised" quite so simply. The brain is exercised, and this takes years. Language, Human or otherwise, are some of the most complicated structures to parse and understand; you can no more write a Ruby program after learning C then you could write a poem in Coast Salish after learning Hebrew.

Also, I must point out the erroneous use of the term "benchmark". Benchmarking applies only to machines. you don't benchmark people, you "test" them, and testing has a known margin of error, unlike benchmarking, which for the most part presents clearcut answers.

To summarize, the OP is an idiot. Quote from: BC_Programmer on July 25, 2009, 02:15:46 PM
The OP is saying, basically, that if it takes that long to learn it, they aren't very good.
Quote from: mad.casual on July 24, 2009, 03:38:57 PM
A 70s era bodybuilder (I can't remember who) once said, [sic]Lift weights, eat three meals a day, and take dianabol (a steroid), if you haven't put on five pounds by the end of the month, take up stamp collecting.

We have software benchmarks, hardware benchmarks, and even language benchmarks. But are there benchmarks out there for the people behind the code? e.g. If anybody takes a year to learn PHP, they really shouldn't be having anything to do with writing web pages. Or if someone claims to read/write C but takes two weeks to make a Python or Ruby file that calculates and displays all the prime numbers between 1 and 10^9 in less than 5 min. Either they didn't are a liar (didn't really know C), are really bad at math, don't convert from natural to machine language very well, and/or don't optimize code very well.


Quote from: BC_Programmer on July 25, 2009, 02:15:46 PM
To summarize, the OP is an idiot.
I agreeNo, the original poster is not an idiot; he simply renders a poor argument.  He forgets there are no true benchmarks in bodybuilding, either.  I am also rather sure that there are plenty of successful bodybuilders of all levels who have not followed the advice given in the quote, either.
478.

Solve : Need a c++ windows app tutorial?

Answer»

hi,

I am in desperate need of a windows APPLICATION tutorial because I'm tired of MAKING text based programs. can someone please give me a LINK to a good website.

thanks in advance,

batchmaster60this is where i LEARNED:
http://www.geocities.com/Heartland/Meadows/9818/win32tut/index.html
windows programming is messy
Thank you so much P.S. ACER ROCKS!!!

but I'm getting an asus lol they about the same as an acer but cheaperyour welcome for the link

479.

Solve : VBA code urgent?

Answer»

This is the code I have, the cancel button in the input box when pressed still prints the INVOICE, I have a tried a lot of combinations, any help would be appreciated
Code: [Select]Private Sub PRINT_Click()
    On Error Resume Next
    ' CopyNumber is global
    Dim NumCopies As Integer, ReportDest As Integer, Msg As String, Payment As Currency, Response As String

    'Hide the Invoice Print Dialog
    Forms![yInvoice Print Dialog].Visible = False
    ' Destination is Print Preview
    If Forms![yInvoice Print Dialog]![TabSubfrm].Form![TYPE of Output] = 1 Then
        ReportDest = A_PREVIEW
      Else      ' Destination is printer
        ReportDest = A_NORMAL
    End If
    NumCopies = Forms![yInvoice Print Dialog]![TabSubfrm].Form![Number Copies].Value
    PrintMessages = Forms![yInvoice Print Dialog]![TabSubfrm].Form![Print Messages].Value
    PrintPayments = Forms![yInvoice Print Dialog]![TabSubfrm].Form![Print Payments].Value
    ' Determine Print Criteria selected
   
   



   
    Msg = "How much is being paid by" & vbCrLf & "Credit CARD on this Invoice?"
    Payment = InputBox(Msg, "Credit Card Payment", 0)
   
   
   





    Select Case Forms![yInvoice Print Dialog]![TabSubfrm].Form![Type of Print]
        Case 1    ' Current Record
            ' Print Standard Invoice
            If Forms![yInvoice Print Dialog]![TabSubfrm].Form![Invoice] = -1 Then
                For CopyNumber = 1 To (NumCopies - 1)
                    If Forms![yInvoice Print Dialog]![TabSubfrm].Form![Separate Shipments] Then
                        DoCmd.OpenReport "Invoice -Separated", ReportDest, , "[Invoice]![Invoice Number]=[Forms]![Invoice]![Invoice Number]"
                    Else
                        DoCmd.OpenReport "Invoice", ReportDest, , "[Invoice]![Invoice Number]=[Forms]![Invoice]![Invoice Number]", , Payment
                    End If
                Next CopyNumber
                        DoCmd.OpenReport "Invoice-Unsigned", ReportDest, , "[Invoice]![Invoice Number]=[Forms]![Invoice]![Invoice Number]", , Payment
               
            End If
            ' Print Pro Forma Invoice
            If Forms![yInvoice Print Dialog]![TabSubfrm].Form![Pro Forma Invoice] = -1 Then
                For CopyNumber = 1 To NumCopies
                    If Forms![yInvoice Print Dialog]![TabSubfrm].Form![Separate Shipments] Then
                        DoCmd.OpenReport "Invoice -Separated", ReportDest, , "[Invoice]![Invoice Number]=[Forms]![Invoice]![Invoice Number]"
                    Else
                        DoCmd.OpenReport "Invoice-ProForma Title", ReportDest, , "[Invoice]![Invoice Number]=[Forms]![Invoice]![Invoice Number]", , Payment
                    End If
                Next CopyNumber
            End If
            ' Print Packing List
            If Forms![yInvoice Print Dialog]![TabSubfrm].Form![Packing List] = -1 Then
                For CopyNumber = 1 To NumCopies
                        DoCmd.OpenReport "Packing List", ReportDest, , "[Invoice]![Invoice Number]=[Forms]![Invoice]![Invoice Number]"
                Next CopyNumber
            End If
            ' Print Commercial Invoice one copy only
            If Forms![yInvoice Print Dialog]![TabSubfrm].Form![Commercial Invoice] = -1 Then
            DoCmd.OpenReport "Invoice-Customs", ReportDest, , "[Invoice]![Invoice Number]=[Forms]![Invoice]![Invoice Number]", , Payment
            End If
        Case 2      ' Date Range
            ' Print Standard Invoice
            If Forms![yInvoice Print Dialog]![TabSubfrm].Form![Invoice] = -1 Then
                For CopyNumber = 1 To NumCopies
                    If Forms![yInvoice Print Dialog]![TabSubfrm].Form![Separate Shipments] Then
                        DoCmd.OpenReport "Invoice -Separated", ReportDest, , "([Invoice Type] = 'F' OR [Invoice Type] = 'I') AND ([Invoice]![Invoice Date] Between [Forms]![yInvoice Print Dialog]![TabsubFrm].Form![From Date] And [Forms]![yInvoice Print Dialog]![TabsubFrm].Form![To Date])"
                    Else
                        DoCmd.OpenReport "Invoice", ReportDest, , "([Invoice Type] = 'F' OR [Invoice Type] = 'I') AND ([Invoice]![Invoice Date] Between [Forms]![yInvoice Print Dialog]![TabsubFrm].Form![From Date] And [Forms]![yInvoice Print Dialog]![TabsubFrm].Form![To Date])"
                    End If
                Next CopyNumber
            End If
            ' Print Simple Invoice
            'If Forms![yInvoice Print Dialog]![TabSubfrm].Form![Simple Invoice] = -1 Then
            '    For CopyNumber = 1 To NumCopies
            '        If Forms![yInvoice Print Dialog]![TabSubfrm].Form![Separate Shipments] Then
            '            DoCmd.OpenReport "Invoice Single LINE -Separated", ReportDest, , "([Invoice Type] = 'F' OR [Invoice Type] = 'I') AND ([Invoice]![Invoice Date] Between [Forms]![yInvoice Print Dialog]![TabsubFrm].Form![From Date] And [Forms]![yInvoice Print Dialog]![TabsubFrm].Form![To Date])"
            '        Else
            '            DoCmd.OpenReport "Invoice Single Line", ReportDest, , "([Invoice Type] = 'F' OR [Invoice Type] = 'I') AND ([Invoice]![Invoice Date] Between [Forms]![yInvoice Print Dialog]![TabsubFrm].Form![From Date] And [Forms]![yInvoice Print Dialog]![TabsubFrm].Form![To Date])"
            '        End If
            '    Next CopyNumber
            'End If
            ' Print Preprinted Form
            If Forms![yInvoice Print Dialog]![TabSubfrm].Form![Preprinted Form] = -1 Then
                For CopyNumber = 1 To NumCopies
                    If Forms![yInvoice Print Dialog]![TabSubfrm].Form![Separate Shipments] Then
                        DoCmd.OpenReport "Invoice Just Data -Separated", ReportDest, , "([Invoice Type] = 'F' OR [Invoice Type] = 'I') AND ([Invoice]![Invoice Date] Between [Forms]![yInvoice Print Dialog]![TabsubFrm].Form![From Date] And [Forms]![yInvoice Print Dialog]![TabsubFrm].Form![To Date])"
                    Else
                        DoCmd.OpenReport "Invoice Just Data", ReportDest, , "([Invoice Type] = 'F' OR [Invoice Type] = 'I') AND ([Invoice]![Invoice Date] Between [Forms]![yInvoice Print Dialog]![TabsubFrm].Form![From Date] And [Forms]![yInvoice Print Dialog]![TabsubFrm].Form![To Date])"
                    End If
                Next CopyNumber
            End If
        Case 3      ' Customer Number
            ' Print Standard Invoice
            If Forms![yInvoice Print Dialog]![TabSubfrm].Form![Invoice] = -1 Then
                For CopyNumber = 1 To NumCopies
                    If Forms![yInvoice Print Dialog]![TabSubfrm].Form![Separate Shipments] Then
                        DoCmd.OpenReport "Invoice -Separated", ReportDest, , "([Invoice Type] = 'F' OR [Invoice Type] = 'I') AND ([Sold to Customer]=[Forms]![yInvoice Print Dialog]![TabsubFrm].Form![Customer Number])"
                    Else
                        DoCmd.OpenReport "Invoice", ReportDest, , "([Invoice Type] = 'F' OR [Invoice Type] = 'I') AND ([Sold to Customer]=[Forms]![yInvoice Print Dialog]![TabsubFrm].Form![Customer Number])"
                    End If
                Next CopyNumber
            End If
            ' Print Pro Forma Invoice
            If Forms![yInvoice Print Dialog]![TabSubfrm].Form![Pro Forma Invoice] = -1 Then
                For CopyNumber = 1 To NumCopies
                    If Forms![yInvoice Print Dialog]![TabSubfrm].Form![Separate Shipments] Then
                        DoCmd.OpenReport "Invoice -Separated", ReportDest, , "[Invoice]![Invoice Number]=[Forms]![Invoice]![Invoice Number]"
                    Else
                        DoCmd.OpenReport "Invoice-ProForma Title", ReportDest, , "[Invoice]![Invoice Number]=[Forms]![Invoice]![Invoice Number]", , Payment
                    End If
                Next CopyNumber
            End If
            ' Print Preprinted Form
            If Forms![yInvoice Print Dialog]![TabSubfrm].Form![Preprinted Form] = -1 Then
                For CopyNumber = 1 To NumCopies
                    If Forms![yInvoice Print Dialog]![TabSubfrm].Form![Separate Shipments] Then
                        DoCmd.OpenReport "Invoice Just Data -Separated", ReportDest, , "([Invoice Type] = 'F' OR [Invoice Type] = 'I') AND ([Sold to Customer]=[Forms]![yInvoice Print Dialog]![TabsubFrm].Form![Customer Number])"
                    Else
                        DoCmd.OpenReport "Invoice Just Data", ReportDest, , "([Invoice Type] = 'F' OR [Invoice Type] = 'I') AND ([Sold to Customer]=[Forms]![yInvoice Print Dialog]![TabsubFrm].Form![Customer Number])"
                    End If
                Next CopyNumber
            End If
            ' Print Mailing Labels
            If Forms![yInvoice Print Dialog]![TabSubfrm].Form![Commercial Invoice] = -1 Then
                        DoCmd.OpenReport "Invoice-Customs", ReportDest, , "([Invoice Type] = 'F' OR [Invoice Type] = 'I') AND ([Sold to Customer]=[Forms]![yInvoice Print Dialog]![TabsubFrm].Form![Customer Number])"
            End If
    End Select
'    DoCmd.Close A_FORM, "yInvoice Print Dialog"

End Subwhen you press "cancel" inputbox returns an empty string. So check for that after the inputbox:

Code: [Select] Payment = InputBox(Msg, "Credit Card Payment", 0)
if payment="" then exit sub

480.

Solve : Can't figure it out :(?

Answer»

Code: [Select]Public Class Form1

    Private Sub Button1_click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
        Dim Therandom As New Random
        If RadioButton1.Checked = True Then
            Label1.Visible = False
            Label2.Visible = False
            Label3.Visible = False
            Label1.Text = Therandom.Next(1, 5)
            If TextBox1.Text = Label1.Text Then
                Label1.Visible = True
                Label2.Visible = True
                Label3.Visible = True
                Label3.Text = "You are correct :O"
                Button1.Enabled = False
                TextBox1.Enabled = False
            Else
                Label1.Visible = True
                Label2.Visible = True
                Label3.Visible = True
                Label3.Text = "You LOSE :|"
                Button1.Enabled = False
                TextBox1.Enabled = False
            End If
        ElseIf RadioButton2.Checked = True Then
            Label1.Visible = False
            Label2.Visible = False
            Label3.Visible = False
            Label1.Text = Therandom.Next(1, 15)
            If TextBox1.Text = Label1.Text Then
                Label1.Visible = True
                Label2.Visible = True
                Label3.Visible = True
                Label3.Text = "You are correct :O"
                Button1.Enabled = False
                TextBox1.Enabled = False
            Else
                Label1.Visible = True
                Label2.Visible = True
                Label3.Visible = True
                Label3.Text = "You lose X("
                Button1.Enabled = False
                TextBox1.Enabled = False
            End If
        ElseIf RadioButton3.Checked = True Then
        End If
        Label1.Visible = False
        Label2.Visible = False
        Label3.Visible = False
        Label1.Text = Therandom.Next(1, 50)
        If TextBox1.Text = Label1.Text Then
            Label1.Visible = True
            Label2.Visible = True
            Label3.Visible = True
            Label3.Text = "You are correct :D!"
            Button1.Enabled = False
            TextBox1.Enabled = False
        Else
            Label1.Visible = True
            Label2.Visible = True
            Label3.Visible = True
            Label3.Text = "You lose :(("
            Button1.Enabled = False
            TextBox1.Enabled = False
        End If
        If RadioButton3.Checked = True Then
            Label1.Visible = False
            Label2.Visible = False
            Label3.Visible = False
            Label1.Text = Therandom.Next(1, 50)
            If TextBox1.Text = Label1.Text Then
                Label1.Visible = True
                Label2.Visible = True
                Label3.Visible = True
                Label3.Text = "You are correct :D!"
                Button1.Enabled = False
                TextBox1.Enabled = False
            Else
                Label1.Visible = True
                Label2.Visible = True
                Label3.Visible = True
                Label3.Text = "You lose :(!"
                Button1.Enabled = False
                TextBox1.Enabled = False
            End If
        ElseIf RadioButton3.Checked = True Then
        End If
        Label1.Visible = False
        Label2.Visible = False
        Label3.Visible = False
        Label1.Text = Therandom.Next(1, 50)
        If TextBox1.Text = Label1.Text Then
        End If

        If RadioButton1.Checked = True Then
            Label1.Visible = False
            Label2.Visible = False
            Label3.Visible = False
            Label1.Text = Therandom.Next(1, 5)
            Label1.Visible = True
            Label2.Visible = True
            Label3.Visible = True
            Label3.Text = "You are correct :O"
            Button1.Enabled = False
            TextBox1.Enabled = False
        Else
            Label1.Visible = True
            Label2.Visible = True
            Label3.Visible = True
            Label3.Text = "You LOSE :|"
            Button1.Enabled = False
            TextBox1.Enabled = False
        End If
        If RadioButton2.Checked = True Then
            Label1.Visible = False
            Label2.Visible = False
            Label3.Visible = False
            Label1.Text = Therandom.Next(1, 15)
            If TextBox1.Text = Label1.Text Then
                Label1.Visible = True
                Label2.Visible = True
                Label3.Visible = True
                Label3.Text = "You are correct :O"
                Button1.Enabled = False
                TextBox1.Enabled = False
            Else
                Label1.Visible = True
                Label2.Visible = True
                Label3.Visible = True
                Label3.Text = "You lose X("
                Button1.Enabled = False
                TextBox1.Enabled = False
            End If
        ElseIf RadioButton3.Checked = True Then
        End If
        Label1.Visible = False
        Label2.Visible = False
        Label3.Visible = False
        Label1.Text = Therandom.Next(1, 50)
        If TextBox1.Text = Label1.Text Then
        End If
        Label1.Visible = True
        Label2.Visible = True
        Label3.Visible = True
        Label3.Text = "You are correct :D!"
        Button1.Enabled = False
        TextBox1.Enabled = False

        Label1.Visible = True
        Label2.Visible = True
        Label3.Visible = True
        Label3.Text = "You lose :(("
        Button1.Enabled = False
        TextBox1.Enabled = False

        If RadioButton3.Checked = True Then
            Label1.Visible = False
            Label2.Visible = False
            Label3.Visible = False
            Label1.Text = Therandom.Next(1, 50)
            If TextBox1.Text = Label1.Text Then
                Label1.Visible = True
                Label2.Visible = True
                Label3.Visible = True
                Label3.Text = "You are correct :D!"
                Button1.Enabled = False
                TextBox1.Enabled = False
            Else
                Label1.Visible = True
                Label2.Visible = True
                Label3.Visible = True
                Label3.Text = "You lose :(!"
                Button1.Enabled = False
                TextBox1.Enabled = False
            End If
        ElseIf RadioButton3.Checked = True Then
            Label1.Visible = False
            Label2.Visible = False
            Label3.Visible = False
            Label1.Text = Therandom.Next(1, 50)
        End If
    End Sub
End Class
Public Class Form1

    Private Sub Button2_click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
        Label1.Text = "0"
        Label1.Visible = False
        Label2.Visible = False
        Label3.Visible = False
        Button1.Enabled = True
        TextBox1.Enabled = True
        TextBox1.Text = ""
    End Sub
End Class

I want to make a litle game called Gues the nomber the PROBLEM is that i don't understand why it gives me this warnings
Warning   1   The type Form1 is made of SEVERAL partial classes in the same file.         

Warning   2   class 'Form1' and partial class 'Form1' declared in 'C:\Documents and Settings\Administrator\Local Settings\Application Data\Temporary Projects\Gues the number!\Form1.Designer.vb' conflict in namespace 'Gues_the_number_', but are being merged because one of them is declared partial.   C:\Documents and Settings\Administrator\Local Settings\Application Data\Temporary Projects\Gues the number!\Form1.vb   Gues the number!

Warning   3   class 'Form1' and partial class 'Form1' declared in 'C:\Documents and Settings\Administrator\Local Settings\Application Data\Temporary Projects\Gues the number!\Form1.Designer.vb' conflict in namespace 'Gues_the_number_', but are being merged because one of them is declared partial.   C:\Documents and Settings\Administrator\Local Settings\Application Data\Temporary Projects\Gues the number!\Form1.vb   Gues the number!

Please tell me what is wrong because i can't FIGURE it out why i get this warnings .

481.

Solve : Edit saved data in VB6?

Answer»

Dear Sir

I need really urgent help. I have a database table in Access 2002 & I'm using VB6. I can save data and also can display data after searching from the database table on a form in VB6. Now I WANT to edit that particular data which I have fetched from the database table by searching and which is DISPLAYING on the form in VB6. After that, I want to edit that particular data that is displaying. After editing I will save that edited data in the table. At this point currently edited data/record will be superimposed on previous data. And that is what I need to know. Please see my code which I have used for data save & find, in below.

Code: [Select]Dim RST As New ADODB.Recordset

CODE FOR SAVE:
Private Sub cmdsave_Click()
DBconnect
If rst.State = adStateOpen Then rst.Close
rst.Open "tblsystemusing", CNT, adOpenDynamic, adLockOptimistic

With rst
        .AddNew
        .Fields(0) = cmbfloor.Text
        .Fields(1) = cmbuser.Text
        .Fields(2) = cmbusercode.Text
        .Fields(3) = cmbitemname.Text
        .Fields(4) = cmbitemrefno.Text     
        .Update
         MsgBox "Saved"
End Sub

CODE FOR FIND:
Private Sub cmdfind_Click()
DBconnect
If rst.State = adStateOpen Then rst.Close
rst.Open "tblsystemusing", cnt, adOpenDynamic, adLockOptimistic

While Not rst.EOF

        If cmbusername.Text = rst.Fields(1) Then
       
        With rst
        cmbfloor.Text = .Fields(0)
        cmbuser.Text = .Fields(1)
        cmbusercode.Text = .Fields(2)
        cmbitemname.Text = .Fields(3)
        cmbitemrefno.Text = .Fields(4)
        End With
        End If
       
rst.MoveNext
Wend
End Sub


Please come back at your earliest as I have fallen in difficulties with this.

Regards
talorababu

482.

Solve : Useful Pieces Of Code?

Answer»

Hi Everybody,

The point of this thread is so that people can post different pieces of code that other people can integrate into their programs.

When posting please include the following information:

- The LANGUAGE e.g. Visual Basic, C#, C++ .etc
- A description of what it does
- The code itself (In a code box)
- Where the code should be placed e.g. a Command Button's click event

I would also recommend that if you find a PIECE of code useful that you press the thanks button on their post.

Cameron GrayCracked open my old module that I no longer use (all my code that I use daily is wrapped in classes).


VB6; Place wherever...

ShellSort routine:

Code: [Select]Sub ShellSort(A As Variant, Optional ByVal LB As Long = 0, Optional ByVal UB As Long = 0)
     Dim N As Long
     Dim H As Long
     Dim I As Long
     Dim j As Long
     Dim T As Variant
     If LB = 0 And UB = 0 Then
          LB = LBound(A)
          UB = UBound(A)
     End If
               ' sort array[lb..ub]
     
               ' compute largest increment
     N = UB - LB + 1
     H = 1
     If (N < 14) Then
          H = 1
     Else
          Do While H < N
               H = 3 * H + 1
          Loop
          H = H \ 3
          H = H \ 3
     End If
     
     Do While H > 0
                    ' sort by insertion in increments of h
          For I = LB + H To UB
               T = A(I)
               For j = I - H To LB Step -H
                    If A(j) <= T Then Exit For
                    A(j + H) = A(j)
               Next j
               A(j + H) = T
          Next I
          H = H \ 3
     Loop
     
End Sub


Or, a small procedure to find the maximum of a set of items.

Code: [Select]Public Function Max(ParamArray Params) as Variant
    Dim I as long,CurrMax as Variant
    CurrMax=vbempty
    For I = 0 to ubound(Params)
        if IsEmpty(CurrMax) or Params(I) > CurrMax then
            CurrMax = params(I)
        end if
    Next I
    Max = CurrMax
End Function

a Min() function can easily be created by switching the comparison operator. (and of course the function name).

another small routine for shuffling an array.

Code: [Select]Public Sub ShuffleArray(ByRef vArray As Variant, Optional startIndex As Variant, Optional endIndex As Variant)
     Dim I As Long
     Dim rndIndex As Long
     Dim Temp As Variant
     
     If IsMissing(startIndex) Then
          startIndex = LBound(vArray)
     End If
     
     If IsMissing(endIndex) Then
          endIndex = UBound(vArray)
     End If
     
     For I = startIndex To endIndex
          rndIndex = Int((endIndex - startIndex + 1) * Rnd() + startIndex)
         
          Temp = vArray(I)
          vArray(I) = vArray(rndIndex)
          vArray(rndIndex) = Temp
     Next I
End Sub


All of these are self-contained. Either put them in a module or a class.


Thanks BC_Programmer Anybody else?

The code can be for anything, Even a simple Hello World.

Cameron Graynot really usefull....or advanced, but its used in visual basic to just reverse a string

Code: [Select]dim rvstr
rvstr = "Blarg"
rvstr = StrReverse(rvstr)
msgbox rvstr
so you can use it in VB6... 2 TEXT box(rvs and out), 1 command button(cmnd),


Command button:
Code: [Select]rvstr = StrReverse(rvs.text)
out.txt = rvstror a VB5 Version of the function:

Code: [Select]Function StrReverse(ByVal Inputstr As String)
Dim X As Integer, stringer As String, Rstr As String, s As String
Rstr = ""
stringer = Inputstr
For X = Len(stringer) To 1 Step -1
     s = Mid$(stringer, X, 1)
     Rstr = Rstr & s
Next X
StrReverse = Rstr

End Function

And it's a commandbutton, silly. Command box, LOL.

oop corrected,

terribly sorry, new to vb  well.. it is shaped LIKE a box.

As long as you don't call a form a window box...  you know, that would explain why my programs aren't working!!

483.

Solve : [Perl] IRC Bot ":roc.esper.net 451 * liam-BOT :Register first."?

Answer»

I am SIMPLY trying to create a bot that connects to a server and runs some simple scripts for an IRC channel my friend runs --

-- i ripped the CODE from a site so it's not exactly mine, but I can't seem to get it working with roc.esper.net. -- Heres the code, it's a single file so you can simply throw it in your own core.pl.

Code: [Select]#!/usr/bin/perl
#perl ircbot by netcomm


#lets set some varibles

$server = "roc.esper.net"; #server
$port = 5555;              #port
$NICK = "liam-BOT";         #nick
$ident = "liam-BOT";        #ident
$realname = "LiamsBot";  #realname
$chan = "#testirc";        #channel
$pass = "";                #pass
$su = "liam";              #super user
$OWNERS = "liam";          #owners




use IO::Socket;

$irc=IO::Socket::INET->new(
                PeerAddr=>$server,
                PeerPort=>$port,
                Proto=>'tcp')or die "DEAD!";
               
                                print "PerlBot by netcomm\n";
                                print "$nick has connected to $server on $chan\n";
                                print $irc "USER $ident $ident $ident $ident :$realname\n";
                                print $irc "NICK $nick\n";
                                print $irc "PRIVMSG nickserv//services.dal.net :identify $pass\n";
                                print $irc "join $chan\n";
                                print $irc "PRIVMSG $owners :$nick is online\n";
                           
                           while(defined($in=<$irc>)){
                                         
                                               
                                               
                                                 
                                                        ### Start of commands   
                                               



if($in=~/^:(.+)\!.+ JOIN\b/){print $irc "PRIVMSG $1 :hello $1 welcome to $chan\n";}
if($in=~/PING(.*)/){print $irc "PONG :$1\n";} # MUST LEAVE THIS LINE
print "$in\n"; # AND THIS ONE



next unless $in =~ /^:$owners\b/; #makes bot only respond to owner
 

sub about {
if($in=~/!about/)
{print $irc "PRIVMSG $chan :I am a ircbot written in perl by netcomm\n";}
}

sub opdeop {
if($in=~/!op /)
{print $irc "MODE $chan +o $'\n";}
if($in=~/!deop /)
{print $irc "MODE $chan -o $'\n";}
}

sub joinpart {
if($in=~/!join / & $in=~/$su/)
{print $irc "join :$'\n";}
if($in=~/!part / & $in=~/$su/)
{print $irc "part :$'\n";}
}
                               
sub kickban {
if($in=~/!kickban /)
{print $irc "kick $chan $' :TXTbot ownz da world\n";}
if($in=~/!kickban /)
{print $irc "mode $chan +b $'\n";}
}

sub kick {
if($in=~/!kick /)
{print $irc "kick $chan $' :TXTbot ownz da world\n";}
}

sub raw {
if($in=~/!raw / & $in=~/$su/)
{print $irc " $'\n";}
}


sub say {
if($in=~/!say /)
{print $irc "PRIVMSG $chan :$'\n";}
}
 
sub quit {
if($in=~/!quit/ & $in=~/$su/)
{print $irc "PRIVMSG $chan :Seya\n";}
if($in=~/!quit/)
{print $irc "QUIT\n";}
}

sub name {
if($in=~/!nick / & $in=~/$su/)
{print $irc "nick :$'\n";}
}

sub rehash {
if($in=~/!rehash/ & $in=~/$su/)
{print $irc "PRIVMSG $chan :Rehashing...\n";}
if($in=~/!rehash/ & $in=~/$su/)
{print $irc "QUIT\n";}
if($in=~/!rehash/ & $in=~/$su/){
system("bot.pl");}
if($in=~/!rehash/ & $in=~/$su/){
print $irc "join $chan";}
}

sub viewusers {
if($in=~/!users/)
{print $irc "PRIVMSG $chan :Current Users:$owners\n";}
}


#sub calls

&viewusers;
&rehash;
&raw;
&kickban;
&say;
&name;
&kick;
&about;
&opdeop;
&joinpart;
&quit;

}
close($irc);

484.

Solve : Black screen 4 on line videos?

Answer»

Hi..I'm a newbie 2 this forums...I do have some comp.experience. My problem is when I try 2 watch a on line video all I get is a black screen,no sound or anything. Some game sites don't EVEN load and when I try 2 cash my points in at mycokerewards I get nothing. My computer was dragging, so this lady went and "FIXED it." She fixed it all right..I've tried everything I can think of and nothing helps.I even did a System Restore but she redid that so it goes 2 the date that she "fixed" my computer..
Anyhelp at all would b GREATLY APPRECIATED & tnxs well this could be a problem with your flash player as much as it can be a spyware problem or your webbrowser.

so you can update to the latest flash player here

and what Web-browser are you using?I already updated my flash & I'm using Internet Ex.

485.

Solve : recommend good online courses for SQL, data controls??

Answer»

Can ANYBODY recommend GOOD online courses for SQL and/or data CONTROLS? (I guess I should master the regular data controls before going on to SILVERLIGHT, right?)

486.

Solve : Excel vlookup with a date?

Answer»

I am trying to use vlookup in excel 2002 and the lookup value is a date (1-1-2004). There are 2 columns in the table array, first column has 1-12 and second column has Jan-Dec. The result of the lookup value is December, which is wrong. I TRIED changing the format of the date (2004-1-1 ETC.) but the end result is the same. The vlookup function I used was =vlookup(b2,a2:b13,2).
Does anyone know why I am having a PROBLEM with a date value? Other lookup functions that I tried WITHOUT using a date worked fine.

ThanksTry changing your formula to:  =vlookup(month(b2),a2:b13,2)Thanks, Oldun. It works with the the function you wrote.

487.

Solve : Perl IRC bot?

Answer»

I recently wrote an IRC bot in perl and it works except for the fact that it will not respond to pings. I have posted the code below so can you PLEASE tell me the code and where to insert it.

Thanks

Cameron Gray

Code: [Select]#!/usr/bin/perl -w

use Net::IRC;
use strict;

# create the IRC object
my $irc = new Net::IRC;

# Create a connection object.  You can have more than one "connection" per
# IRC object, but we'll just be working with one.
my $conn = $irc->newconn(
        Server          => 'irc.mibbit.com',
        PORT            => '6667',
        Nick            => 'WelcomeBot',
        Ircname         => 'WelcomeBot v1.0',
        Username        => 'WelcomeBotv1.0'
);

# We're going to add this to the conn hash so we know what channel we
# WANT to operate in.
$conn->{channel} = shift || '#Bots';

sub on_connect {

        # shift in our connection object that is passed automatically
        my $conn = shift;

        # when we connect, join our channel and greet it
        $conn->join($conn->{channel});
        $conn->privmsg($conn->{channel}, 'Hello everyone!');
        $conn->{connected} = 1;

}

sub on_join {

        # get our connection object and the event object, which is passed
        # with this event automatically
        my ($conn, $event) = _;

        # this is the nick that just JOINED
        my $nick = $event->{nick};
        my $channel = $conn->{channel};
        # say hello to the nick in public
        $conn->privmsg($conn->{channel}, "Hello $nick - Welcome to $channel -  $
        # Remember to make line above only on one line after editing
}

# add event handlers for join and part events
$conn->add_handler('join', \&on_join);

# The END of MOTD (message of the day), numbered 376 signifies we've connect
$conn->add_handler('376', \&on_connect);

# start IRC
$irc->start();

Thanks in advance
Cameron Gray

P.S. DO NOT tell me to stop using Net::IRC like everyone else is 

You should see my bot in #bots on irc.mibbit.com - It is called WelcomeBot and will say Quote

<WelcomeBot> Hello [NICK] - Welcome to #Bots -  Have fun!
488.

Solve : does anybody know dos vga programming??

Answer»

i really need 640x480 4 bpp vga programming help (no libarys please)
i tried Google and got nothinwhat kind of help?Is this for homework?no
its for a game i am writing (myself)
but i dont want to use bios or libarys
because 4 fps is not GOOD enougheveything on internet says 320x200 8bpp
just FINE for colors but 320x200
not so good
need atleast 512x300
If I remember correctly 640x480x4bpp that's "SCREEN 12" in QBASIC- but what language are you working with?


C / C++
i know its screen mode 12hex
asm {
mov ax,12h
int 10h
}
but how do i put pixels without bgi, libarys and bios rotines
i should be able to just write to A000:0000
but i think THERES like vga planes or something
http://www.osdever.net/FreeVGA/vga/vga.htmthanks bc_programmer that helps

489.

Solve : FOXPRO 6.2a...?

Answer»

is it possible to run a BATCH FILE in a using the FOXPRO .prg?
I'm doing a PROGRAM in foxpro and I want to run the .bat in my program...

490.

Solve : its! all about flash game!?

Answer»

how can i make flash game?    Follow this link.flash is bad Quote from: smeezekitty on AUGUST 16, 2009, 01:28:36 AM

flash is bad

why?slow, resource pig, unportable and needing CONSTANT updates
just my opinion
i dont like flash games
what about java instead its more supported and faster (i am pretty sure)unportable... and yet every major OS has a Flash Player...

Java requires a lot more programming skill. with a flash game you can LITERALLY draw the OBJECTS, program the actionscript, etc, With Java one would need to learn AWT and probably Swing before even attempting to make a game even close to on-par with a Flash game.

I might also add that the Flash Program (IE, Macromedia Flash... now ADOBE Flash...) was relatively heavyweight, but the programs were fairly small, and definitely not resource intensive (CPU intensive on older machines, though, because of the Vector-based graphics). Compare this to say, "netbeans IDE"




Quote
needing constant updates
Just so you know, Java is now at v12 and Flash is at v10.

Quote
and faster (i am pretty sure)
How fast the applet loads depends on at least two things: 1) Internet connection, 2) how big the applet is.
491.

Solve : batch file automatically runs^^?

Answer»

I WANT to secure my files so that PEOPLE who want to copy my programs will PREVENT him from ACCESSING itDoes this have anything to do with your other topic(s)?YAPS!!!
my idea is to convert .bat to .exe
is it possiblepossible?Yes - Google it. Quote

yaps!!!

492.

Solve : Hardware Programming?

Answer»

What is hardware programming ?

How to configure hardware programming?Your question means nothing and cannot be answered. Was it just a TEST?
Click here.Or here  #4 was hilarious! very intuitive though.... Quote from: fartbubble on MAY 22, 2011, 03:29:14 AM

#4 was hilarious! very intuitive though....

Duh Quote from: Betty on May 22, 2011, 04:12:40 AM
Duh
calm downor get a helmet
493.

Solve : VB6 - Mix Up Array?

Answer»

Hello,

I need VB6 (not .NET) code to randomly mix up an array. Thanks in advance!

*Fleexy*module:

Code: [Select]Option Explicit

Public Sub Swap(ByRef valueA As Variant, ByRef ValueB As Variant)
Dim Temp As Variant
Temp = valueA
valueA = ValueB
ValueB = Temp



End Sub

Public Sub Shuffle(ArrayShuffle() As Variant)
Dim I As Long, RandomIndex As Long
Randomize Timer
'loop through the array. swap each item with a randomly chosen index
For I = LBound(ArrayShuffle) To UBound(ArrayShuffle)
RandomIndex = INT(LBound(ArrayShuffle) + (Rnd * (UBound(ArrayShuffle) - LBound(ArrayShuffle))))
Swap ArrayShuffle(I), ArrayShuffle(RandomIndex)
Next I

End Sub


I SUPPOSE you could make equivalent functions if you need a sort routine for a specific type.Thanks for your REPLY, but NEVER mind, I got it. Silly RND returning a number less than 1.HI! I'm beginner.. I have visual Basic 6.0 I want study visual basic. when I vb first coming some form. what is the us of this form? then how can I start to create my own programme?I would read the help first.

494.

Solve : Mac VB.NET Compiler?

Answer»

I REALLY need a MAC compiler for vb. Help!!Google.com? Sound familiar?

WELL there is a certain version of "Mac" that will come Pre-Installed with a compiler. Otherwise you can try to do some research on how to make one..

Not MUCH help from me, I am a WINDOWS user...

Sorry
MerlynMonoOkay then... BC_Programmer realbasic

495.

Solve : install multiple application using batch file?

Answer»

Hi friends I WANT to make a CD which installs 5-6 programs such as adobe reader, ms office etc. automatically using batch file. pls help meI've found a couple of things that could be interesting:

1) Using msiexec with commandline switches

2) Quote

it is not so easy, because most of software installers has no command line support for batch mode installations

3) (for the programmers out here who can help the OP by reading this):

Quote
You could package the applications you want to install into the projects resource file, then at run time unpack them into a temporary location and execute them. Depending on what it is you packing\unpacking you may be able to use the /S or /Silent parameters. If not, why not have a go at doing what the install program does manually. It should all be possible..

Heres an example

http://download.microsoft.com/download/vb60ent/samp10/1/win98/en-us/resfile.exe

SUMMARY
RESFILE.EXE is a sample project that shows how to store any file type in a resource file and retrieve the file for use at run-time.

http://support.microsoft.com/kb/194409

4) Less interesting, an application that does it for you: AllMyApps

5) (Also for the programmers out there to help the OP) A guy who wrote such a script, but his full source is not available:

Quote
I wrote a script to install multiple applications but would like them to wait until the previous install is complete. I know I can use the WSCript.Sleep command but I believe I can only vary that command on a time limit. I need something that acts like...install application 'a'; install application 'b' once installation for application 'a' is complete; install application 'c' once installation for application 'b' is complete.

This is a small piece from my script:

objShell.Run "\\sdc-ris\MSI_Package\gpo\Application_GPO\Illustrator\Illustrator.vbs"
objShell.Run "\\sdc-ris\MSI_Package\gpo\Application_GPO\InDesign\InDesignCS2.vbs"
objShell.Run "\\sdc-ris\MSI_Package\gpo\Application_GPO\Quark\Quark6.vbs"

---------

Taken from the WSH documents

Run Method
bWaitOnReturn
Optional. Boolean VALUE indicating whether the script should wait for the program to finish executing before continuing to the next statement in your script. If set to true, script execution halts until the program finishes, and Run returns any error code returned by the program. If set to false (the default), the Run method returns immediately after starting the program, automatically returning 0 (not to be interpreted as an error code).

6) "Linking Multple MSI files through VB script"

Solution 1
Quote
Accepted Solution (works):
Code: [Select]objshell = createobject("shell.scriptingobject")

objshell.run "c:\1.msi"
objshell.run "c:\2.msi"

Solution 2
Quote
I don't believe that ShellExecute is really going to provide the functionality that you want without some serious pain. If you can use WSH the following code will work fine:

Dim wsh
Set wsh = CreateObject("WScript.Shell")
wsh.run "msiexec /i foo.msi", ,1
wsh.run "msiexec /i foo2.msi", ,1

If it truly is impossible to use, another options, albeit a bit painful, would be to use the start.exe command found in NT-based OS's. You could write a batch file which looks like this:

start /wait msiexec /i foo.msi
start /wait msiexec /i foo2.msi

Not sophisticated, but functional.

If, by chance, you have access to modify the MSI's - you could also write custom actions to essentially "chain" the MSI's internally.

You could also write a wrapper MSI which would launch all of the other MSI installations with the appropriate command lines. This, again, is a bit unconventional and quite messy. Wise for Windows Installer would make this task fairly easy, though.

Treval
Program I use to make installers for my stuff:

http://www.advancedinstaller.com/download.html

Now, that being said- the main reason I didn't respond earlier was because

A:) the CD is obviously meant for distribution
and
B:) you are including copyright software on it.Lmao actually I also found that advancedinstaller but I thought hey, since he's asking a batch file maybe we should just give it to him that way instead of a THIRD party app.. =OThanks for giving lot of information...Thanks for giving lot of information...you could do
Code: [Select]start adobeinstaller.exe
start etc.exe
...
496.

Solve : Batch Rename with leading zeros help!?

Answer»

Hello,

Ok, I need some serious ASSISTANCE with batch files. I know I'm new here but plan to now visit regularly. I am trying to perform the following:

1. count all files in a directory
2. rename a file numerically based on total file count + 1
3. append that new filename with leading zeros until a total character count of 8 total characters is in the file name

What I've got so far will count all files, rename file to numerical name but won't let me append leading zeros. Can anyone help with this?

dir "c:\Talasa\frames" /a-d | find /c ".jpg" > NUMfiles.###
set /p count=Echo %count%
set /a counted=%count%+1

ren c:\Talasa\ftp\*.jpg %counted%.jpg
move C:\Talasa\ftp\*.jpg C:\Talasa\frames
You should try to do this with another language, say vbs. In batch, things like this could get long and confusingunfortunatly for my purposes it must be done in a batch file. one of those it's too late to turn back now things. :SRESOLVED, not overly elegant but the solution is:

Code: [Select]REM COUNT TOTAL IMAGES IN FRAMES TO DETERMINE NEXT IMAGE NUMBER IN SEQUENCE
dir "c:\Talasa\frames" /a-d | find /c ".jpg" > NUMfiles.###
set /p count=<NUMfiles.###
REM DISPLAY COUNTED NUMBER
Echo !count!
REM SET VARIABLE TO VALUE OF COUNTED IMAGES +1
set /a counted=%count%+1

SETLOCAL ENABLEDELAYEDEXPANSION
Set SearchForChar=.
Set CharPos=

set currentpath="c:\Talasa\frames"
set filepath="c:\Talasa\ftp\

ren c:\Talasa\ftp\*.jpg %counted%.jpg

CD %filepath%

for %%f in ("*.jpg") do set filename=%%f

Set CheckString=%1
IF NOT Defined CheckString Set CheckString=%filename%
IF NOT Defined CheckString GOTO :EOF

FOR /l %%a in (0,1,10) DO IF "!CheckString:~%%a,1!" == "%SearchForChar%" SET /a CharPos=%%a + 1 & IF DEFINED CharPos GOTO CharFound
ECHO "%SearchForChar%" was not found in "%CheckString%"
GOTO :EOF

:CharFound
set /a trueplace=%CharPos%-1
ECHO String Number Ends in "%CheckString%" at position %trueplace%

CD %currentpath%

if [%trueplace%]==[1] GOTO 1
if [%trueplace%]==[2] GOTO 2
if [%trueplace%]==[3] GOTO 3
if [%trueplace%]==[4] GOTO 4
if [%trueplace%]==[5] GOTO 5
if [%trueplace%]==[6] GOTO 6
if [%trueplace%]==[7] GOTO 7
if [%trueplace%]==[8] GOTO 8

:1

ren c:\Talasa\ftp\*.jpg 0000000%counted%.jpg
move C:\Talasa\ftp\*.jpg C:\Talasa\frames
GOTO :EOF

:2
ren c:\Talasa\ftp\*.jpg 000000%counted%.jpg
move C:\Talasa\ftp\*.jpg C:\Talasa\frames
GOTO :EOF

:3
ren c:\Talasa\ftp\*.jpg 00000%counted%.jpg
move C:\Talasa\ftp\*.jpg C:\Talasa\frames
GOTO :EOF

:4
ren c:\Talasa\ftp\*.jpg 0000%counted%.jpg
move C:\Talasa\ftp\*.jpg C:\Talasa\frames
GOTO :EOF

:5
ren c:\Talasa\ftp\*.jpg 000%counted%.jpg
move C:\Talasa\ftp\*.jpg C:\Talasa\frames
GOTO :EOF

:6
ren c:\Talasa\ftp\*.jpg 00%counted%.jpg
move C:\Talasa\ftp\*.jpg C:\Talasa\frames
GOTO :EOF

:7
ren c:\Talasa\ftp\*.jpg 0%counted%.jpg
move C:\Talasa\ftp\*.jpg C:\Talasa\frames
GOTO :EOF

:8
ren c:\Talasa\ftp\*.jpg %counted%.jpg
move C:\Talasa\ftp\*.jpg C:\Talasa\frames
GOTO :EOF

:end
This is simpler...

1. Edit folder name

2. This code, and also your code above uses no sort-order switch after the dir command. This means that the order of jpg NAMES found by dir is the current Windows default (if you have set dircmd environment variable, if that contains a sort order switch e.g. /on, then the output of a bare dir command will be sorted that way.) If dircmd is not set, then the default sort is by name, ascending) If you wish to FORCE a particular sort order then insert the switch after "dir" e.g. dir /on or dir /o-d or whatever. See dir /? for help.

3. Remove the echo before REN when you are HAPPY it works the way you want.

Code: [Select]@echo off
setlocal enabledelayedexpansion
set JPGfolder=C:\Users\Mike\Pictures\Camera Photos\Jazmina Pictures\subfolder
cd /d "%JPGfolder%"
set number=1
for /f "delims=" %%F in ( 'dir /b *.jpg' ) do (
set oldname=%%~nxF
set newname=!number!.jpg
if !number! LEQ 9999999 set newname=0!newname!
if !number! LEQ 999999 set newname=0!newname!
if !number! LEQ 99999 set newname=0!newname!
if !number! LEQ 9999 set newname=0!newname!
if !number! LEQ 999 set newname=0!newname!
if !number! LEQ 99 set newname=0!newname!
if !number! LEQ 9 set newname=0!newname!
echo REN "!oldname!" "!newname!"
set /a number+=1
)

Code: [Select]REN "dsc00366.jpg" "00000001.jpg"
REN "dsc00386.jpg" "00000002.jpg"
REN "dsc00399.jpg" "00000003.jpg"
REN "dsc00410.jpg" "00000004.jpg"
REN "dsc00411.jpg" "00000005.jpg"
REN "dsc00412.jpg" "00000006.jpg"
REN "dsc00414.jpg" "00000007.jpg"
REN "dsc00415.jpg" "00000008.jpg"
REN "dsc00416.jpg" "00000009.jpg"
REN "dsc00417.jpg" "00000010.jpg"
REN "dsc00418.jpg" "00000011.jpg"
REN "dsc00419.jpg" "00000012.jpg"
REN "dsc00420.jpg" "00000013.jpg"
REN "dsc00421.jpg" "00000014.jpg"
REN "dsc00423.jpg" "00000015.jpg"
REN "dsc00430.jpg" "00000016.jpg"
REN "dsc00431.jpg" "00000017.jpg"
REN "dsc00432.jpg" "00000018.jpg"
less code; same result

Code: [Select]@echo off
setlocal enabledelayedexpansion
set JPGfolder=C:\Users\Mike\Pictures\Camera Photos\Jazmina Pictures\subfolder
cd /d "%JPGfolder%"
set number=1
for /f "delims=" %%F in ( 'dir /b *.jpg' ) do (
set newname=!number!.jpg
for %%N in (9999999 999999 99999 9999 999 99 9) do if !number! LEQ %%N set newname=0!newname!
echo REN "%%~nxF" "!newname!"
set /a number+=1
)
select number of leading zeroes

Code: [Select]@echo off
setlocal enabledelayedexpansion
set JPGfolder=C:\Users\Mike\Pictures\Camera Photos\Jazmina Pictures\subfolder
cd /d "%JPGfolder%"

REM 1=no leading zeroes, 2 to 8, pad to that length
set namelength=8

if %namelength% GEQ 2 set formatstring=9
if %namelength% GEQ 3 set formatstring=99 %formatstring%
if %namelength% GEQ 4 set formatstring=999 %formatstring%
if %namelength% GEQ 5 set formatstring=9999 %formatstring%
if %namelength% GEQ 6 set formatstring=99999 %formatstring%
if %namelength% GEQ 7 set formatstring=999999 %formatstring%
if %namelength% GEQ 8 set formatstring=9999999 %formatstring%

set number=1
for /f "delims=" %%F in ( 'dir /b *.jpg' ) do (
set newname=!number!.jpg
for %%N in (%formatstring%) do if !number! LEQ %%N set newname=0!newname!
echo REN "%%~nxF" "!newname!"
set /a number+=1
)

497.

Solve : c++ clearing buffer?

Answer»

is there a SIMPLE way to erase everything in the KEYBOARD BUFFER?
im making a space invaders kinda game, but im using getch() instead of the normal cin. getch() reads in one character from the buffer at a time, but when the ship gets hit by the enemy i have the have the program pause for 3 seconds, during the 3 seconds any keys PRESSED gets processed and i dont want that to happen. cin.ignore messes up the input badly, im not sure why or how it does this but it doesnt work.

my code looks something like this

char m = getch();
if(ship == hit)
flash();

void flash()
{
Sleep(3000);
COUT <<"you died!\n";
cin.ignore(5);
}
anything entered during the Sleep(3000) is processed and causes unwanted movement

498.

Solve : vb.net game engine?

Answer»

I need some people to work on a vb.net GAME engine. it is made in gdi and currently only supports 2D. if you want to JOIN, type in your EMAIL. i will ADD you to the people list in google code project hosting. the url is:http://code.google.com/p/vb-dot-net-game-engine/
my email:[emailprotected]

and you must have gmail because that's what google hosting allows

499.

Solve : Base64 encoding then "paste"...........?

Answer»

Basically i work for an isp and need to telnet to a sever and use:
HELO
auth login



I WOULD like to beable to copy and paste the UN and PW into the script and have it Base64 it.
It doesnt need to do the telnet....yet but thats what im going to try and figure out. i just need a little help with the encoding.

Thanks for your time and effort.

The_valkyrieNever mind. I found out that i need the ScriptUtilities Library w/ ASP.
It needs to use the ByteArray method of CreateObject. haha i really don't want to buy the library.
Thanks for viewing though.............

500.

Solve : Game help in SDL for C++?

Answer»

Hi, I've just got into game programming with SDL a couple of weeks ago. I have been programming in C++ for a while now so I got all that down, but what I want to do for a game IDEA is to make a sort of map LAYOUT in an SDL window kind of like a 2D MAZE sort of thing. I am thinking it would be simply just initializing a NEW SURFACE but I wouldn't know where to go after that. Thanks all for the help