Jump to content
Sign in to follow this  

Importing Data Into Gui

Recommended Posts


Hlo Ppl

I have been working with this program for about a week.

Programing Background - Basic ( the original )

My question is about displaying data on a Gui or is it Koda screen (real time) !

I acutally dont know if it can be done.

Just a example ( Stock Exchange )

Just a example or if we wanted to track some price data and time ( Ebay )

Just a example lets say we wanted to build a calculator ( Basic )

Maybe I have it all wrong and the buttons just display or carry out control orders that are built into GUI.

Ok one more example.

Lets say we wanted to write a script that produced a random number every 10 seconds. How would we display this random number on the Gui that our loop was generating.

That simple script would probably start me in the right direction.

Thanks for any input on this you could give.


Share this post

Link to post
Share on other sites

you should see this tutorial...


but this is a script like you suggested

#include <GuiConstants.au3>

GUICreate("My Stock Market Analyser", 300, 200)
$label = GUICtrlCreateLabel("Press *Check Now* to see your stock value", 50, 100, 250, 20)
$btn = GUICtrlCreateButton("Check Now", 90, 150, 120, 20)

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then
    if $msg = $btn Then Get_Stocks()

Func Get_Stocks()
Dim $StockPrice
;In the middle of a stock market simulation game
$StockPriceChange = Random(-10, 10, 1) ; generate an integer between -10 and 10
$StockPrice = $StockPrice + $StockPriceChange
If $StockPriceChange < 0 Then
    GUICtrlSetData($label, "Your stock dropped to $" & $StockPrice)
ElseIf $StockPriceChange > 0 Then
    GUICtrlSetData($label, "Your stock rose $" & $StockPrice)
    GUICtrlSetData($label, "Your stock stayed at $" & $StockPrice)




Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this