Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / GetDeviceBaseName() error

Author
Message
Unseen Ghost
22
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 22nd Nov 2021 23:58 Edited at: 23rd Nov 2021 00:05
Hi,

If I run the following code:


I get this error:

main.agc:57: error: Incompatible types "Integer" and "String"

I can't figure out why

If I take the "android" out it compiles fine, maybe I need to check for each one seperately?
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex

No one cares how much you know until they know how much you care.
JosephB
18
Years of Service
User Offline
Joined: 12th Sep 2006
Location:
Posted: 23rd Nov 2021 00:20
You should replace line 33, If DeviceName$ = "iPhone" Or "android" in your snippet with If DeviceName$ = "iPhone" Or DeviceName$ = "android". It should work then.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 23rd Nov 2021 00:20
kinda:
Unseen Ghost
22
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 23rd Nov 2021 01:35 Edited at: 23rd Nov 2021 01:36
Quote: " You should replace line 33, If DeviceName$ = "iPhone" Or "android" in your snippet with If DeviceName$ = "iPhone" Or DeviceName$ = "android". It should work then.
"


Thank you JosephB

Thank you Virtual Nomad
Changing the code to what both of you suggested worked
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex

No one cares how much you know until they know how much you care.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 23rd Nov 2021 11:50
I have a function setup for detecting device and setting the resolution (among other things) so I can just test things without changing any code, simple but effective

Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 23rd Nov 2021 12:02 Edited at: 23rd Nov 2021 12:04
@PTC
You can simplify that code with select...case and do it all inside a single function call
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 23rd Nov 2021 15:14 Edited at: 23rd Nov 2021 15:18
I know, but ...

Quote: "(among other things) "



Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
Unseen Ghost
22
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 24th Nov 2021 04:29
Thank you Scraggle and PartTimeCoder, I'll give both of your snippets a try
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex

No one cares how much you know until they know how much you care.

Login to post a reply

Server time is: 2024-11-23 08:24:25
Your offset time is: 2024-11-23 08:24:25