为什么这个 GOTO 在 BASIC 256 中不起作用?

问题描述

I=imread('circlesColored.png');
% Get the image as a b&w indexed (non-rgb) image
R=I(:,:,1);
R=(R>35&R<255);
imshow(R);
bwareaopen(I,50);
 BW = gray2ind(R,2);
%Calculate its connected regions
L = bwlabel(BW); % Not using bwconncomps() for older version users
stats = regionprops(L,'Extent','Area');
%Find the ones that are like a circle
minextent = 0.75;
keepMask = [stats.Extent]>minextent;
%Extract the image of circles only and display
BWcircles = ismember(L,find(keepMask));
BWnonCircles = BW & ~BWcircles;
%show the circles
figure,imshow(BWcircles)

为什么这段代码在 BASIC 256 中不起作用?我已经在 qb64 中尝试过它并且有效。

解决方法

自从我上次用 BASIC 编程已经好几年了,但我记得有不同的风格语言(C、Pascal 和其他语言也是如此)。

我搜索了一些 QB64Basic 256:简短的回答是 QB64 的 BASIC 风格支持行号,但是Basic 256 实现了不支持行号的更新版 BASIC。

为了在 BASIC 256 中使用 GOTO,您必须使用标签(任何标识符后跟冒号“:”)

thisIsALabel: Print "What is your name" 
input nameperson$ 
Print "What is your Dad's name" 
input ageperson$ 
Print "Your Name is ";nameperson$;" ";ageperson$ 
GOTO thisIsALabel

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...