Page 1 of 1

what are you "programming" right now?

Posted: Tue May 10, 2005 2:12 pm
by debaser
hello. i'm new. i'm a newbie.
nice to meet this community.

my question is simple. what do you do with pure basic? what are you workin on right now?

i'm writing a simple application with 2 buttons: "browse" and "send".
this stupid program let you search in your hard drive an audio file and send it to a specified FTP server. then it sends an email with the link (like: ftp.server.com/mysong.mp3) to the rest of my band. not so useful but quite amazing for me right now. i'm writing it because the other musicians of my band don't now how to use an ftp client and we need to listen our ideas every day.

my little question: the program use an external TXT file where i wrote the SMTP server address and the email of my friends.

like :

Code: Select all

smtp.server. com
mail@mail.com
mail2@mail. com
i used this code

Code: Select all

If ReadFile(0, "server.txt")

          server$ =  Trim(ReadString())
    
       CloseFile(0)
so my app read the server address. but how can i teach him to read on the second line the first email address and on the 3rd line the second email address?




bye

marco[/code]

Posted: Tue May 10, 2005 2:15 pm
by debaser
sorry i now that this topic should be in the beginner page

:oops:

Posted: Tue May 10, 2005 2:43 pm
by NoahPhense
Quite easy..

Code: Select all

If ReadFile(0, "server.txt") 
  line1$ = Trim(ReadString())
  line2$ = Trim(ReadString())
  line3$ = Trim(ReadString())
  CloseFile(0)
Else
  ; could not read the file
EndIf
- np

Posted: Tue May 10, 2005 3:47 pm
by Joakim Christiansen
I'm currently working on a strategy game, and I want it to be almost like RedAlert.
I don't think I ever will finish it, but I'll work until I get stuck. :lol:

Posted: Tue May 10, 2005 8:49 pm
by Num3
LoL,

I'm just working in an idea about paralel encryptation with diferent algorithms on the same stream.

You need a key and a password.

Key defines the 'order' of how the paralel algo's start their work, and the key makes the salt element over the encryptation...

Another use for this algo is to make Hash keys which are *almost* impossible to repeat / crack.

Posted: Tue May 10, 2005 9:37 pm
by GedB
debaser,

I know I should be encouraging you to use PB, but for sending FTB REBOL really does make it easy. The core engine is free!

http://www.rebol.com/docs/core23/rebolc ... section-11

Posted: Wed May 11, 2005 12:16 am
by debaser
no please....no more software :)

ok. i'll be really boring.
i'm using FTP_LIP
what i can't do is:


....to find the file to upload

Code: Select all

SongName$ = OpenFileRequester("Scegli il file da caricare", "", "Audio files|*.mp3;*.wav;*.wma|All Files|*.*", 0)
and then....

Code: Select all

FTP_UploadProgress("server","user","pass",21,"new",SongName$,WHATIPUTHERE???? ,#Bar)  
 
so ok "whatiputhere" is my issue. this is the place to put the name of the file as it will be on the server. if i put "SongName$" it doesn't work. if i put a name like "mysong.mp3" it works. but i would like it to preserve the name of the source file. i think it has to do with string conversion. but i can't handle it. can you help me?
last thing. i've tried to access my own ftp server (that i have on my computer) and it works well. it doesn't work when i try to connect to my remote server. does it makes sense?

thanks a lot.
you are great.
marco

Posted: Wed May 11, 2005 2:08 am
by Paul
First off, OpenFileRequester() will include the full path from your harddrive as well as file name so "SongName$" could contain "C:\My Files\mysong.mp3" which of course is invalid for FTP file path.

You need to use SongName$=GetFilePart(SongName$) which will then return "mysong.mp3"

Next you must know exact path on FTP server where the files must go...
You then supply this in the "Dir" field. In your example you have "new" in this field so the "new" folder MUST exist on the server you are sending to.

Posted: Wed May 11, 2005 1:56 pm
by debaser
yes it works!
thanks a lot guys.
wow.