Author Topic: Dim Shared v's Parameters & Arguments  (Read 6238 times)

0 Members and 1 Guest are viewing this topic.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Dim Shared v's Parameters & Arguments
« Reply #30 on: December 18, 2020, 08:28:30 pm »
Hi Pete
I like your red hair
BUT... you have posted a demo of DIM SHARED and not about SHARED!
this one is a demo of SHARED!
Code: QB64: [Select]
  1. TYPE democrat
  2.     dumb AS STRING
  3.  
  4. DIM dimwit AS democrat
  5.  
  6. dimwit.dumb = "All Democrats are idiots.": CALL idiots
  7. idiots2
  8.  
  9. SUB idiots
  10.     PRINT dimwit.dumb
  11.  
  12. SUB idiots2
  13.     SHARED dimwit AS democrat
  14.     PRINT dimwit.dumb
  15.  
  16.  

And Thanks, with your modded demo I have learnt that it is possible to declare a variable that includes a point in its name! In Idiots dimwit.dumb is a single type of variable with a point in its name!
Programming isn't difficult, only it's  consuming time and coffee

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Dim Shared v's Parameters & Arguments
« Reply #31 on: December 18, 2020, 09:02:12 pm »
Isn't a period a valid character in a variable anyway?

DIM x.a AS INTEGER, x.b AS LONG
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Dim Shared v's Parameters & Arguments
« Reply #32 on: December 18, 2020, 09:25:50 pm »
Yes Steve
in fact I have said
Quote
I have learnt that it is possible to declare a variable that includes a point in its name
for the simple reason that I have always used the character period only when I have typed an UDT. But this is an my habit that let me think that period is invalid for normal name of variable, so now I have learnt this new possibility in writing a name of variable.
Programming isn't difficult, only it's  consuming time and coffee

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Dim Shared v's Parameters & Arguments
« Reply #33 on: December 19, 2020, 12:27:04 pm »
I'm glad it shed some light on something new for you... It just goes to show us all that Democrats are, indeed, useful idiots.

Pete :D

Trump 2020, and beyond!
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/