Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

The ''Da VB Code''

This is where you can discuss your homework, family, just about anything, make strange sounds and otherwise discuss things which are really not related to the Lancer-series. Yes that means you can discuss other games.

Post Fri Feb 04, 2005 4:56 pm

The ''Da VB Code''

Okay, bit misleading and a crap pun, but I thought it was time I started a thread of my shenanigans.....and there is no accounting for taste is there

What? P0rn?! Erm, sorry - no, and before anyone gets really disappointed - this also isn't anything to do with religion as the pun title may have suggested

Its to do with VB - Visual Basic - programming language.

The background is easy - Accushot makes some fantastic little programs which we use in modding, and dammit, it made me wonder

Anyways, after an Xmas bonus - I had some 'unexpected' cash to spend...so didn't mind blowing 70 notes on the program (that includes delivery and insurance - it was 50 quid to buy). Once bought and installed - I quickly, erm, forgot about it.
What brought me back to the thing was a rememberance of an issue with the Freelancer:Explorer - and the creation of tradelanes. You 'draw' the tradelane on the nav map - but its often up to 6k away from where you wanted it to be - either due to nav map size (cannot see location) or alternatively due to a set 7k between rings not dividing into the distance correctly. Needless to say that I got fed up of using a calculator and pen/paper to figure out where anything up to 20 rings could be.
So - my first venture was to make a tradelane calculator - which I started off making in Excel (first time I ever used Excel) and finished off making in VB. Its dirty, rough and unrefined - but when you enter the start and end coords, it works just fine
I would have posted a running dialogue on the creation of that item, and still will explain what I did if I thought it would be interesting - but since its 'solved' - I will only post what I found/did if asked.
However, I have another 'project' in line - and this one is, erm, very ambitious indeed! Simply put - i know how to define a few variables, and know how to do some simple calculations.

Post Fri Feb 04, 2005 5:03 pm

So what is the 'project' I mentioned I hear you ask?

Its a calendar - of sorts.
Here is a 'screenshot' and description of the thing:



So - as you can see from the attachement - its a 'calender'. Before you even begin to think - yes, this will need a database (or method of datastorage...erm - a database!). The good news is that I have not got a foggiest how to do this in VB (although I could do it in php ).

Let me outline it though - you have yourself a nice lil 'calender' at the top - you can choose dates, it also shows todays date. The form to the left of that is the 'information' form. Notice the title and body of text? The update button, and exit button - as well as the delete checkbox.

Below all this is an 'area' - although I guess this will become a listbox for convenience later!
The simple idea is that you open up the program, click on the date you want to add an entry for (and the month). Type in the Title of the entry, and then type in the body of the text. The date you selected will be the 'diary entry day'. HIt update, and it adds your entry to the database for that day.

So what is all the rest for then? Okay - the list box is simply going to display the title of your entry for whatever day you select.....so if you start the program, it will 'automatically' check todays date alongside its entries. If there is one for that day, it will pull it up and display it (title only) in the listbox. This way, you can select any date and see what is already in there, as well as being able to the add to it.

Double clicking on any item in the list box will pull the information into the form (title/body). This is simply so you can edit the information and update it (so changing your entry) - or, click on the checkbox to select the delete and hit update to delete it.

Nice and simple. If you have more than one entry for one day, they will be shown in list order on the listbox - you can select whichever you like.

So, adventorous indeed - as I have no clue what to do from this point on. Well - I will have a clue at some point, but right now I pull up crap about SQL databases


Oh, and this one gets MORE complicated as well. That is the BASIC function of it. The 'extra frilly bits' that I would also include eventually (but more complex).
1) Add it to the startup of the computer - so that when windows starts, the program starts.
2) Make it run in the 'tray' location...so when computer starts, it starts - but appears in the tray, and not on screen.
3) If there is anything for the day of the computer turning on - a small alert box (like your Windows updater kinda thing) pops up from teh tray - only a couple of inchs across - discreet, and informs you that you have something to do etc.


Those are the frilly bits, and yes, It may take ages to be able to do that (like several months, to 5/6 months - simply because I have to learn how to do stuff, and understand WHY I do stuff - not just jump around!!).
That is also why I think this one will be ambitious - and will take many months for me to learn enough to be able to do it all. Heck - I gotta sort out the database and stuff first! Oh well - this one is going to take some time.

So - the design (preliminary) is underway, it can and WILL change (comments/criticism/suggestions are welcome).
I will be posting as I go along, and like i said - its going to take TIME....time and effort.
However, if anyone wants to suggest anything, ask questions, give hints, tips or comments - then please, feel free. If you just want to laugh at me making a complete idiot of myself as I bumble on through this weird and wonderfully fascinating topic called 'learning to code on the fly for the impatient learner' - then feel free All I ask is that NO ONE posts up a solution for me! I will welcome hints and tips/suggestions and code on how to do things I do not understand - but not the whole shebang! If anyone does add etc - please try to explain WHY the code you used is there, cause I will probs have to go read around it for a day or two to catch up

I know this thread will probabily fall flat on its face with very little interaction, mainly because right now it has nothing of interest, and is probabily only of limited interest to posters - but hell, time for some diversity and something NEW!
I will update with some progress tomorrow..........as I have actually got somewhere so far

Edited by - Chips on 2/4/2005 5:03:36 PM

Post Fri Feb 04, 2005 5:13 pm

Pretty interesting program for learning to code, especially if you end up having to calculate dates and times.

As for your list of more complicated stuff... all three of those things are pretty easy to do

You said you know php... so i have to ask why you chose VB? The obvious step from php is C/C++/C# or Java because they share the same syntax.

Post Fri Feb 04, 2005 5:38 pm

hehe - when I say 'know php' - think of it more along the lines of I have a vague knowledge. I certainly cannot code any decent programs in php at all. I know I could do the above to a certain extent (drop box for dates etc), as I have got good familiarity with forms and database creation/queries/updates etc using php - but I haven't got it installed.

Probabily the biggest single reason for VB though is Accushot. Accu can help/point things out/make suggestions - or just plain tell me what I have done wrong. I can upload the project etc to let him have a look at if I am really stuck, and post up my code/read his posted code as well. I didn't know anyone who used C++ or was willing to explain things from a real basic level either

The reason for this thread is simply because the little topic we had for the calc became a very popular topic indeed , so I thought I would see whether others enjoyed my inane rambling (I have a habit of kinda talking to myself in the post, explaining what I want to do and then trying it out/posting results).

Post Fri Feb 04, 2005 6:39 pm

When he says he "talks to himself" in these threads, he means it too. I have seen him ask a question, than answer himself in the same post. When you read one of these threads you really begin to understand how Chips' brain works, and sometimes it's quite scary.

Post Fri Feb 04, 2005 7:30 pm

Cool...we now find out that Chip's has a brain

Return to Off Topic