Qbasicnews.com
November 20, 2019, 05:34:22 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: 1 [2]
  Print  
Author Topic: QBasic Challenge :-)  (Read 8993 times)
Neo
Na_th_an
*****
Posts: 2150



« Reply #15 on: January 08, 2004, 06:47:39 AM »

You can implicitly preserve the values though... Wink

Here:
Code:
'$DYNAMIC
DEFINT A-Z

CONST INDEXSIZE = 2

DIM MyArray(10) AS INTEGER

'fill the array
FOR I = LBOUND(MyArray) TO UBOUND(MyArray)
   MyArray(I) = INT(RND * 100)
NEXT I

'now copy the array
DIM Temp(LBOUND(MyArray) TO UBOUND(MyArray)) AS INTEGER
size% = ((UBOUND(MyArray) - LBOUND(MyArray)) + 1) * INDEXSIZE
FOR I = 0 TO size% - 1
   DEF SEG = VARSEG(MyArray(0))
   byte% = PEEK(VARPTR(MyArray(0)) + I)
   DEF SEG = VARSEG(Temp(0))
   POKE VARPTR(Temp(0)) + I, byte%
NEXT I

'resize other
REDIM MyArray(12) AS INTEGER

'copy again
size% = (UBOUND(Temp) - LBOUND(Temp)) + 1
FOR I = 0 TO size% - 1
   DEF SEG = VARSEG(Temp(0))
   byte% = PEEK(VARPTR(Temp(0)) + I)
   DEF SEG = VARSEG(MyArray(0))
   POKE VARPTR(MyArray(0)) + I, byte%
NEXT I


I haven't tested but theorethically it should work I think Wink
Logged
Zack
*/-\*
*****
Posts: 3974



WWW
« Reply #16 on: January 08, 2004, 11:29:20 AM »

A little simpler to use the PRESERVE option, I think? :wink:
Logged

f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Mango
Wandering Guru
***
Posts: 360



« Reply #17 on: January 08, 2004, 07:11:20 PM »

Well...I started this in QBasic, but then decided to learn C++ instead...

Here's the latest iteration...fixed a bug today.
http://home.bellsouth.net/p/PWP-brightwave
This prog authenticates the files and keeps track of original filename in encrypted form.

It's a console app in the true QB spirit...

EDIT::  I forgot to mention...to use the program, just "drop" the file to be encrypted onto the executable.  Piece of cake.
Logged
BinarySHOCK
Forum Regular
**
Posts: 117



WWW
« Reply #18 on: January 09, 2004, 01:27:48 AM »

Zack:  the PRESERVE option isn't availible in 4.5 at least it isn't in my copy. Pisses me off, had to write my own routines for it Tongue
Logged

very F***ing song remains the same
To everyone who sucks-up for the fame
Out of strength you know we speak the truth
Every trend that dies is living proof

MasterMinds Software
Moneo
Na_th_an
*****
Posts: 1971


« Reply #19 on: January 09, 2004, 02:15:53 AM »

mikkeey123,

I just sent you my time-proven encryption utility program to you email address. I only sent the executable because the QuickBasic source code uses functions from the QuickPak Professional library.

Try it, you'll like it!
*****
Logged
Zack
*/-\*
*****
Posts: 3974



WWW
« Reply #20 on: January 09, 2004, 12:02:02 PM »

Quote from: "BinarySHOCK"
Zack:  the PRESERVE option isn't availible in 4.5 at least it isn't in my copy. Pisses me off, had to write my own routines for it Tongue

As I said, only in 7.1 Smiley
Logged

f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Neo
Na_th_an
*****
Posts: 2150



« Reply #21 on: January 09, 2004, 12:11:19 PM »

Quote from: "Zack"
Quote from: "BinarySHOCK"
Zack:  the PRESERVE option isn't availible in 4.5 at least it isn't in my copy. Pisses me off, had to write my own routines for it Tongue

As I said, only in 7.1 Smiley

I just made routines for it! You could just copy-paste them... Wink
Logged
BinarySHOCK
Forum Regular
**
Posts: 117



WWW
« Reply #22 on: January 10, 2004, 02:40:32 AM »

Zack: heh oops must've missed that part

Neo: i wrote those along time ago and i wrote routines for each array type (str,int,lng,sng, ect), altho your routine seems nicer for ints, more my style all POKEy and stuff, i was 2 lazy when i wrote mine to do it that way.
Logged

very F***ing song remains the same
To everyone who sucks-up for the fame
Out of strength you know we speak the truth
Every trend that dies is living proof

MasterMinds Software
Moneo
Na_th_an
*****
Posts: 1971


« Reply #23 on: January 26, 2004, 01:27:12 AM »

Quote from: "Rhiannon"
QB encryption program 1.03
Simple text encryption by Paul Malcher
Encryption program by Chris Pulley
Encrypt by Adam Perry & Matt Ochs
Crypt by Strategy Surplus
Crypter by Lucas Alonso
File Crypt by Eric McCormick
Hey-Cody by The WebKid
Xor encryption/decryption by Jonathan Leger
Xor encryption by Scott Turchin

Is there something in particular you are looking for that is different from the above programs? Maybe a few more details could help us out in developing something you want to see. Wink

I agree with Rhiannon. Seems like at least once a week someone is looking for an encryption routine with no specific requirements. Like she said, there are a bunch of these routines around, I even have one inside of an encrytion program that I wrote 10 years ago. The actual algorithm is in a sofisticated function written by Ethan Winer. I've been using this successfully all these years. The program has 600 lines of code, so it's not just a flash in the pan. I've offered to send the executable of this program several times to people asking for encryption routines, but they don't seem to want it. I guess they want someone to post a quick and dirty solution for them.
*****
Logged
SCM
Wandering Guru
***
Posts: 311



« Reply #24 on: January 26, 2004, 01:52:05 AM »

Moneo,
A lot of time around gets spent reinventing the wheel, because most of us program for the challenge of it.  There are better programs out there than the ones most of us write, but we enjoy doing it ourselves, and showing off what we have done.
Logged

hrist Jesus came into the world to save sinners, of whom I am first.(I Timothy 1:15)

For God so loved the world, that He gave His only begotten Son,
that whoever believes in Him should not perish, but have eternal life.(John 3:16)
Moneo
Na_th_an
*****
Posts: 1971


« Reply #25 on: January 28, 2004, 01:09:15 AM »

Quote from: "SCM"
Moneo,
A lot of time around gets spent reinventing the wheel, because most of us program for the challenge of it.  There are better programs out there than the ones most of us write, but we enjoy doing it ourselves, and showing off what we have done.

There's a certain amount of truth in what you say, but if you want to do it yourself, then why do you post a request for others to do it for you. If I wanted to do it myself, I would post requests for algorithms to do this subject, and pick the one I like and then code it myself.
*****
Logged
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!