basic

Python 3 - BASIC Simulator

∥☆過路亽.° 提交于 2019-12-12 02:24:43
问题 I'm currently working on a BASIC simulator in Python, as the title suggests. This program should either print "success" or "infinite loop", depending on which one is true. Here is my code: def findLine(prog, target): for l in range(0, len(prog)): progX = prog[l].split() if progX[0] == target: return l def execute(prog): location = 0 while True: if location==len(prog)-1: return "success" else: return "infinite loop" T = prog.split()[location] location = findLine(prog, T) FindLine should take

How do I return an array from an OpenOffice Basic function?

梦想与她 提交于 2019-12-11 23:58:40
问题 I'm reading through the documentation on OpenOffice regarding arrays and it seems like Calc is capable of array functions just like Excel . To test this I created a simple function that should return an array {1, 2, 3} : Function Test() Dim Test(3) As Variant Test(1) = 1 Test(2) = 2 Test(3) = 3 End Function When I populate a cell with =Test() and press Ctrl+Shift+Enter I just get a cell with 3 in it. Where are 1 and 2 ? What am I doing wrong? I'm running OpenOffice 4.1.1 . 回答1: The

How to copy specific columns from one sheet and paste in another sheet in a different range?

好久不见. 提交于 2019-12-11 13:29:48
问题 I am a beginner and I have this code below, but this just copies the last row from sheet and pastes into sheet 2 range. Basically the empty row is not getting updated. And also throws run time error 1004 - Application defined or object defined error. Any help would be much appreciated. Sub copypaste() Dim lastrow As Long, erow As Long lastrow = ThisWorkbook.Worksheets("sheet1").Cells(Rows.Count, 1).End(xlUp).Row For i = 2 To lastrow Sheet1.Cells(i, 3).Copy erow = ThisWorkbook.Worksheets(

BBC Basic: Cannot plot rectangle on screen

喜你入骨 提交于 2019-12-10 12:36:45
问题 I recently got my hands on a BBC Micro (model B), and been playing around with it as a hobby project. I'm having some trouble with the graphics commands, and was wondering if anyone could point me in the right direction... I have written the following test program to draw a rectangle on the screen: 10 CLS 20 MODE 5 30 MOVE 0,0 40 PLOT 97,100,100 When I run this, the program completes but no rectangle is drawn (that I can see). I'm using a coaxial cable to connect to a CRT TV, but I don't

Outlook Addin - Visual Basic Windows Forms Application - WebBrowser Control Content not displayed anymore

烈酒焚心 提交于 2019-12-10 11:56:32
问题 We are using an outlook addin (visual basic .NET framework 4 client profile, office 365 business 16.0.11727.20230) that displays some content within a WebBrowser control. I'm not that familiar with visual basic because someone else created this addin and he is not available anymore now, so first of all sorry if i made any basic mistake. Actually the control should display some .xml content but to simplify the question im just trying to display the webpage https://www.google.at for the moment.

What does the assembly instruction trap do?

心不动则不痛 提交于 2019-12-07 15:38:28
" RTFM " A program typically issues a software trap when the program requires servicing by the operating system. The general exception handler for the operating system determines the reason for the trap and responds appropriately. Is the assembly instruction trap alike the instruction TRAP in BASIC? The answer seems to be yes. Can you accept or reject my conclusion? Code for "no interruption" is according to my instructions: noint: PUSH r8 movia r8,0x003b683a # machine code for TRAP ldw et,-4(ea) # read instr closest to return cmpeq et,et,r8 # compare POP r8 bne et,r0,TrapHandler # if equal,

Is there a simple, easy, BASIC for beginners? (What happened to VB 2.0?) [closed]

 ̄綄美尐妖づ 提交于 2019-12-04 19:09:46
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . My son asked if there was an easy language to pick up and do some foundational programming with. I thought QuickBasic at first, but then thought I should just show him VB. I downloaded Visual Basic Express 2008, but I am completely lost. Where is the object toolbar? Where is the form? Where is the property pane?

Visual basic and Json.net Web request

两盒软妹~` 提交于 2019-12-04 05:01:25
问题 Basically what im trying to do is make a program that list game information for league of legends.. using there API to extract data. how this works is you Search there username and it returns an integer linked to that account, you then use that integer to search for all of the information for that account, EG account level, wins, losses, etc. I've run into a problem i can't seem to figure out.. Please not that I'm very new to Json.net so have little experience about working with it.. Below is

What does REM stand for in BASIC?

拟墨画扇 提交于 2019-12-03 22:27:08
Here's a blast from the past: what does "REM", the comment marker, stand for in BASIC? What's the origin of this non-obvious term? I believe it stands for "Remark", that is, a comment. From the MSDN site : Used to include explanatory remarks in the source code of a program. It was REMark, back in the late Steam Age (ca. 1971 or so), when I first encountered BASIC. Most approachable book I've ever found on the language was "My Computer Likes Me (When I Speak In BASIC)", or something like that. For extra credit and mondo greybeard rep points: BASIC is an acronym (maybe a backronym, but whatever)

FREEBASIC 编译可被python调用的dll函数示例-续(1)

拟墨画扇 提交于 2019-12-03 15:58:49
前文我们已经说过了如何用freebasic编制dll被python调用,本节是通过示例来对比其运行效率。 废话不说,上代码: myfib.bas 编译后生成myfib.dll fbc -s gui -dll -export "myfib.bas" 'mylib.bas function fib Cdecl Alias "fib"( x as integer) as Integer Export if x<=1 then return 1 else return fib(x-1) + fib(x-2) end if end function 编译.dll,命名为myfib.dll,拷贝到python.exe 目录下 2. python 代码: # -*- coding: cp936 -*- from ctypes import * lib=CDLL("myfib.dll") # Fibonacci in Python def fibpy(x): if x<=1: return 1 return fibpy(x-1)+fibpy(x-2) # test fibpy(x) def sspy(x): import time t0=time.time() fibpy(x) t1=time.time() print "Python coast time:",(t1-t0) # test dll